pub struct Profile { /* private fields */ }Expand description
Basic validity and selected serialization guarantees.
Validation checks UTF-8 and rejects equivalent map keys using RFC 8949’s basic generic 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 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.