Struct cml_cip36::CIP36RegistrationCbor
source · pub struct CIP36RegistrationCbor {
pub key_registration: CIP36KeyRegistration,
pub registration_witness: CIP36RegistrationWitness,
}
Expand description
This is the entire metadata schema for CIP-36 registration. It can be parsed by passing in the CBOR bytes of the entire transaction metadatum
Fields§
§key_registration: CIP36KeyRegistration
§registration_witness: CIP36RegistrationWitness
Implementations§
source§impl CIP36RegistrationCbor
impl CIP36RegistrationCbor
pub fn new( key_registration: CIP36KeyRegistration, registration_witness: CIP36RegistrationWitness, ) -> Self
sourcepub fn add_to_metadata(
&self,
metadata: &mut Metadata,
) -> Result<(), DeserializeError>
pub fn add_to_metadata( &self, metadata: &mut Metadata, ) -> Result<(), DeserializeError>
Add to an existing metadata (could be empty) the full CIP36 registration metadata
sourcepub fn verify(&self) -> Result<(), CIP36Error>
pub fn verify(&self) -> Result<(), CIP36Error>
Verifies invariants in CIP36.
sourcepub fn to_metadata_bytes(&self) -> Vec<u8> ⓘ
pub fn to_metadata_bytes(&self) -> Vec<u8> ⓘ
Serializes to bytes compatable with Metadata, but containing ONLY the relevant fields for CIP36. If this was created from bytes or from a Metadata that was created from bytes, it will preserve the encodings but only from the metadatums themselves within the keys 61284 and 61285
sourcepub fn from_metadata_bytes(
metadata_cbor_bytes: &[u8],
) -> Result<Self, DeserializeError>
pub fn from_metadata_bytes( metadata_cbor_bytes: &[u8], ) -> Result<Self, DeserializeError>
Create a CIP36 view from the bytes of a Metadata. The resulting CIP36RegistrationCbor will contain ONLY the relevant fields for CIP36 from the Metadata
Trait Implementations§
source§impl Clone for CIP36RegistrationCbor
impl Clone for CIP36RegistrationCbor
source§fn clone(&self) -> CIP36RegistrationCbor
fn clone(&self) -> CIP36RegistrationCbor
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 Debug for CIP36RegistrationCbor
impl Debug for CIP36RegistrationCbor
source§impl<'de> Deserialize<'de> for CIP36RegistrationCbor
impl<'de> Deserialize<'de> for CIP36RegistrationCbor
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl JsonSchema for CIP36RegistrationCbor
impl JsonSchema for CIP36RegistrationCbor
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§impl Serialize for CIP36RegistrationCbor
impl Serialize for CIP36RegistrationCbor
source§impl TryFrom<&Metadata> for CIP36RegistrationCbor
impl TryFrom<&Metadata> for CIP36RegistrationCbor
Auto Trait Implementations§
impl Freeze for CIP36RegistrationCbor
impl RefUnwindSafe for CIP36RegistrationCbor
impl Send for CIP36RegistrationCbor
impl Sync for CIP36RegistrationCbor
impl Unpin for CIP36RegistrationCbor
impl UnwindSafe for CIP36RegistrationCbor
Blanket Implementations§
source§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more