Skip to main content

Serder

Trait Serder 

Source
pub trait Serder:
    Any
    + Send
    + Sync {
Show 16 methods // Required methods fn pretty(&self, size: Option<usize>) -> String; fn raw(&self) -> &[u8] ⓘ; fn sad(&self) -> Sadder; fn genus(&self) -> &str; fn gvrsn(&self) -> &Versionage; fn kind(&self) -> &Kinds; fn proto(&self) -> &str; fn vrsn(&self) -> &Versionage; fn size(&self) -> usize; fn said(&self) -> Option<&str>; fn ilk(&self) -> Option<&str>; fn as_any(&self) -> &dyn Any; fn clone_box(&self) -> Box<dyn Serder>; // Provided methods fn protocol(&self) -> &str { ... } fn version(&self) -> &Versionage { ... } fn saidb(&self) -> Option<Vec<u8>> { ... }
}
Expand description

Trait representing a serializable/deserializable entity with SAID (Self-Addressing IDentifier)

Required Methods§

Source

fn pretty(&self, size: Option<usize>) -> String

Returns a pretty-printed JSON representation of the serialized data

§Parameters
  • size - Optional size limit for the output. None means no limit. This protects against syslog errors when exceeding UDP MTU. IPv4 MTU is 576, IPv6 MTU is 1280, and most broadband routers have 1454 MTU.
Source

fn raw(&self) -> &[u8] ⓘ

Returns the raw bytes representation

Source

fn sad(&self) -> Sadder

Returns a copy of the serializable attribute dictionary (saidified data)

Source

fn genus(&self) -> &str

Returns the CESR genus code for this Serder

Source

fn gvrsn(&self) -> &Versionage

Returns the CESR genus code table version for this Serder

Source

fn kind(&self) -> &Kinds

Returns the serialization kind (value of Serials/Serialage)

Source

fn proto(&self) -> &str

Returns the protocol identifier type (e.g., ‘KERI’ or ‘ACDC’)

Source

fn vrsn(&self) -> &Versionage

Returns the protocol version for this Serder

Source

fn size(&self) -> usize

Returns the number of bytes in the raw representation

Source

fn said(&self) -> Option<&str>

Returns the qb64 SAID (Self-Addressing IDentifier)

Source

fn ilk(&self) -> Option<&str>

Returns the packet type given by sad[‘t’] if any

Source

fn as_any(&self) -> &dyn Any

Source

fn clone_box(&self) -> Box<dyn Serder>

Provided Methods§

Source

fn protocol(&self) -> &str

Alias for proto() - returns the protocol identifier type

Source

fn version(&self) -> &Versionage

Alias for vrsn() - returns the protocol version

Source

fn saidb(&self) -> Option<Vec<u8>>

Returns the qb64b (bytes) representation of the SAID

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Serder for BaseSerder

Source§

impl Serder for SerderACDC

Implement the Serder trait for SerderKERI

Source§

impl Serder for SerderKERI

Implement the Serder trait for SerderKERI