pub struct EncodeOptions<'a> {
pub registry_entry_id: u64,
pub type_table: Option<&'a TypeTable>,
pub canonical: bool,
}Expand description
Options for JSON-LD to CBOR-LD encoding.
Fields§
§registry_entry_id: u64The CBOR-LD registry entry ID. 0 disables semantic compression.
type_table: Option<&'a TypeTable>Registry type table material. Required for compressed IDs other than
1; ID 1 uses an empty default table.
canonical: boolWhether to use cbor2 deterministic/canonical serialization.
Implementations§
Source§impl<'a> EncodeOptions<'a>
impl<'a> EncodeOptions<'a>
Sourcepub fn uncompressed() -> Self
pub fn uncompressed() -> Self
Creates uncompressed CBOR-LD options using registry entry ID 0.
Sourcepub fn compressed(registry_entry_id: u64, type_table: &'a TypeTable) -> Self
pub fn compressed(registry_entry_id: u64, type_table: &'a TypeTable) -> Self
Creates compressed CBOR-LD options.
Trait Implementations§
Source§impl<'a> Clone for EncodeOptions<'a>
impl<'a> Clone for EncodeOptions<'a>
Source§fn clone(&self) -> EncodeOptions<'a>
fn clone(&self) -> EncodeOptions<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for EncodeOptions<'a>
Source§impl<'a> Debug for EncodeOptions<'a>
impl<'a> Debug for EncodeOptions<'a>
Auto Trait Implementations§
impl<'a> Freeze for EncodeOptions<'a>
impl<'a> RefUnwindSafe for EncodeOptions<'a>
impl<'a> Send for EncodeOptions<'a>
impl<'a> Sync for EncodeOptions<'a>
impl<'a> Unpin for EncodeOptions<'a>
impl<'a> UnsafeUnpin for EncodeOptions<'a>
impl<'a> UnwindSafe for EncodeOptions<'a>
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