Enum scrypto::prelude::VersionedSchema
source · #[repr(u8)]pub enum VersionedSchema<S>where
S: CustomSchema,{
V1(SchemaV1<S>),
}
Variants§
Implementations§
source§impl<S> VersionedSchema<S>where
S: CustomSchema,
impl<S> VersionedSchema<S>where
S: CustomSchema,
pub fn new_latest(value: SchemaV1<S>) -> VersionedSchema<S>
pub fn update_once(self) -> UpdateResult<VersionedSchema<S>>
pub fn update_to_latest(self) -> VersionedSchema<S>
source§impl<S> VersionedSchema<S>where
S: CustomSchema,
impl<S> VersionedSchema<S>where
S: CustomSchema,
source§impl<S> VersionedSchema<S>where
S: CustomSchema,
impl<S> VersionedSchema<S>where
S: CustomSchema,
pub fn empty() -> VersionedSchema<S>
Trait Implementations§
source§impl<S, X> Categorize<X> for VersionedSchema<S>where
S: CustomSchema,
X: CustomValueKind,
impl<S, X> Categorize<X> for VersionedSchema<S>where
S: CustomSchema,
X: CustomValueKind,
fn value_kind() -> ValueKind<X>
source§impl<S> Clone for VersionedSchema<S>where
S: Clone + CustomSchema,
impl<S> Clone for VersionedSchema<S>where
S: Clone + CustomSchema,
source§fn clone(&self) -> VersionedSchema<S>
fn clone(&self) -> VersionedSchema<S>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<S> Debug for VersionedSchema<S>where
S: Debug + CustomSchema,
impl<S> Debug for VersionedSchema<S>where
S: Debug + CustomSchema,
source§impl<S, D, X> Decode<X, D> for VersionedSchema<S>where
S: CustomSchema,
D: Decoder<X>,
X: CustomValueKind,
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Decode<X, D> + Categorize<X>,
<S as CustomSchema>::CustomTypeValidation: Decode<X, D> + Categorize<X>,
impl<S, D, X> Decode<X, D> for VersionedSchema<S>where
S: CustomSchema,
D: Decoder<X>,
X: CustomValueKind,
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Decode<X, D> + Categorize<X>,
<S as CustomSchema>::CustomTypeValidation: Decode<X, D> + Categorize<X>,
source§fn decode_body_with_value_kind(
decoder: &mut D,
value_kind: ValueKind<X>
) -> Result<VersionedSchema<S>, DecodeError>
fn decode_body_with_value_kind( decoder: &mut D, value_kind: ValueKind<X> ) -> Result<VersionedSchema<S>, DecodeError>
Decodes the type from the decoder, which should match a preloaded value kind. Read more
source§impl<S> Default for VersionedSchema<S>where
S: CustomSchema,
impl<S> Default for VersionedSchema<S>where
S: CustomSchema,
source§fn default() -> VersionedSchema<S>
fn default() -> VersionedSchema<S>
Returns the “default value” for a type. Read more
source§impl<S, C> Describe<C> for VersionedSchema<S>where
S: CustomSchema,
C: CustomTypeKind<RustTypeId>,
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Describe<C>,
<S as CustomSchema>::CustomTypeValidation: Describe<C>,
impl<S, C> Describe<C> for VersionedSchema<S>where
S: CustomSchema,
C: CustomTypeKind<RustTypeId>,
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Describe<C>,
<S as CustomSchema>::CustomTypeValidation: Describe<C>,
source§const TYPE_ID: RustTypeId = _
const TYPE_ID: RustTypeId = _
The
TYPE_ID
should give a unique identifier for its SBOR schema type.
An SBOR schema type capture details about the SBOR payload, how it should be interpreted, validated and displayed. Read moresource§fn type_data() -> TypeData<C, RustTypeId>
fn type_data() -> TypeData<C, RustTypeId>
Returns the local schema for the given type. Read more
source§fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
fn add_all_dependencies(aggregator: &mut TypeAggregator<C>)
For each type referenced in
get_local_type_data
, we need to ensure that the type and all of its own references
get added to the aggregator. Read moresource§impl<S, E, X> Encode<X, E> for VersionedSchema<S>where
S: CustomSchema,
E: Encoder<X>,
X: CustomValueKind,
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Encode<X, E> + Categorize<X>,
<S as CustomSchema>::CustomTypeValidation: Encode<X, E> + Categorize<X>,
impl<S, E, X> Encode<X, E> for VersionedSchema<S>where
S: CustomSchema,
E: Encoder<X>,
X: CustomValueKind,
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Encode<X, E> + Categorize<X>,
<S as CustomSchema>::CustomTypeValidation: Encode<X, E> + Categorize<X>,
source§fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_value_kind(&self, encoder: &mut E) -> Result<(), EncodeError>
Encodes the SBOR value’s kind to the encoder
source§fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
fn encode_body(&self, encoder: &mut E) -> Result<(), EncodeError>
Encodes the SBOR body of the type to the encoder. Read more
source§impl<S> From<SchemaV1<S>> for VersionedSchema<S>where
S: CustomSchema,
impl<S> From<SchemaV1<S>> for VersionedSchema<S>where
S: CustomSchema,
source§fn from(value: SchemaV1<S>) -> VersionedSchema<S>
fn from(value: SchemaV1<S>) -> VersionedSchema<S>
Converts to this type from the input type.
source§impl<S> HasLatestVersion for VersionedSchema<S>where
S: CustomSchema,
impl<S> HasLatestVersion for VersionedSchema<S>where
S: CustomSchema,
type Latest = SchemaV1<S>
fn into_latest(self) -> <VersionedSchema<S> as HasLatestVersion>::Latest
fn as_latest_ref( &self ) -> Option<&<VersionedSchema<S> as HasLatestVersion>::Latest>
source§impl HasSchemaHash for VersionedSchema<ScryptoCustomSchema>
impl HasSchemaHash for VersionedSchema<ScryptoCustomSchema>
fn generate_schema_hash(&self) -> SchemaHash
source§impl<S> PartialEq for VersionedSchema<S>where
S: PartialEq + CustomSchema,
impl<S> PartialEq for VersionedSchema<S>where
S: PartialEq + CustomSchema,
source§fn eq(&self, other: &VersionedSchema<S>) -> bool
fn eq(&self, other: &VersionedSchema<S>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<S, X> SborEnum<X> for VersionedSchema<S>where
S: CustomSchema,
X: CustomValueKind,
impl<S, X> SborEnum<X> for VersionedSchema<S>where
S: CustomSchema,
X: CustomValueKind,
fn get_discriminator(&self) -> u8
fn get_length(&self) -> usize
impl<S> Eq for VersionedSchema<S>where
S: Eq + CustomSchema,
impl<S> StructuralPartialEq for VersionedSchema<S>where
S: CustomSchema,
Auto Trait Implementations§
impl<S> RefUnwindSafe for VersionedSchema<S>where
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: RefUnwindSafe,
<S as CustomSchema>::CustomTypeValidation: RefUnwindSafe,
impl<S> Send for VersionedSchema<S>where
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Send,
<S as CustomSchema>::CustomTypeValidation: Send,
impl<S> Sync for VersionedSchema<S>where
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Sync,
<S as CustomSchema>::CustomTypeValidation: Sync,
impl<S> Unpin for VersionedSchema<S>where
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: Unpin,
<S as CustomSchema>::CustomTypeValidation: Unpin,
impl<S> UnwindSafe for VersionedSchema<S>where
<S as CustomSchema>::CustomTypeKind<LocalTypeId>: UnwindSafe,
<S as CustomSchema>::CustomTypeValidation: UnwindSafe,
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T, Latest> CloneIntoLatest for Twhere
T: HasLatestVersion<Latest = Latest> + Clone,
impl<T, Latest> CloneIntoLatest for Twhere
T: HasLatestVersion<Latest = Latest> + Clone,
type Latest = Latest
fn clone_into_latest(&self) -> <T as CloneIntoLatest>::Latest
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more