pub struct Profile { /* private fields */ }Expand description
Basic validity and selected serialization guarantees.
Validation checks UTF-8 and rejects equivalent map keys using the selected data model. Registered tag semantics remain opaque; tag 24 has a separate explicit embedded-item validation operation.
Implementations§
Source§impl Profile
impl Profile
Sourcepub fn new(
serialization: Serialization,
lengths: LengthPolicy,
floats: FloatPolicy,
ordering: MapOrdering,
) -> Result<Self, CborError>
pub fn new( serialization: Serialization, lengths: LengthPolicy, floats: FloatPolicy, ordering: MapOrdering, ) -> Result<Self, CborError>
Construct an explicit profile; preferred serialization requires definite lengths.
Sourcepub const fn received() -> Self
pub const fn received() -> Self
Basic validity with received widths, indefinite support, and unsorted unique maps.
Sourcepub const fn preferred() -> Self
pub const fn preferred() -> Self
Preferred widths and definite lengths, with unsorted unique maps.
Sourcepub const fn with_floats(self, policy: FloatPolicy) -> Self
pub const fn with_floats(self, policy: FloatPolicy) -> Self
Select floating-point acceptance without changing other guarantees.
Sourcepub const fn with_map_ordering(self, ordering: MapOrdering) -> Self
pub const fn with_map_ordering(self, ordering: MapOrdering) -> Self
Select map ordering; encoding never sorts caller data automatically.
Sourcepub fn with_map_key_equality(
self,
equality: MapKeyEquality,
) -> Result<Self, CborError>
pub fn with_map_key_equality( self, equality: MapKeyEquality, ) -> Result<Self, CborError>
Select scalar wire equality and structural compound key equality.
Sourcepub fn with_nan_policy(self, policy: NanPolicy) -> Result<Self, CborError>
pub fn with_nan_policy(self, policy: NanPolicy) -> Result<Self, CborError>
Select a NaN width restriction independently of general float acceptance.
Sourcepub const fn map_key_equality(self) -> Option<MapKeyEquality>
pub const fn map_key_equality(self) -> Option<MapKeyEquality>
Inspect the optional map key equality rule.
Sourcepub const fn nan_policy(self) -> Option<NanPolicy>
pub const fn nan_policy(self) -> Option<NanPolicy>
Inspect the optional NaN width restriction.
Sourcepub const fn lengths(self) -> LengthPolicy
pub const fn lengths(self) -> LengthPolicy
Inspect the received length policy.
Sourcepub const fn serialization(self) -> Serialization
pub const fn serialization(self) -> Serialization
Inspect serialization guarantees.
Sourcepub const fn floats(self) -> FloatPolicy
pub const fn floats(self) -> FloatPolicy
Inspect floating-point acceptance.
Sourcepub const fn map_ordering(self) -> MapOrdering
pub const fn map_ordering(self) -> MapOrdering
Inspect the independently selected map-order constraint.