pub struct CodecRegistry { /* private fields */ }Implementations§
Source§impl CodecRegistry
impl CodecRegistry
pub fn new_empty() -> Self
pub fn new_preloaded() -> Self
pub fn register<C: Codec + 'static>(&mut self, kind: CodecKind, codec: C)
pub fn get(&self, kind: &CodecKind) -> Option<Arc<dyn Codec>>
pub fn pick_preferred_codec( &self, supported: &HashSet<CodecKind>, ) -> Option<CodecKind>
pub fn encode( &self, kind: CodecKind, value: &EdgePayload, ) -> Result<Vec<u8>, CodecError>
pub fn decode( &self, kind: CodecKind, bytes: &[u8], ) -> Result<EdgePayload, CodecError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodecRegistry
impl !RefUnwindSafe for CodecRegistry
impl Send for CodecRegistry
impl Sync for CodecRegistry
impl Unpin for CodecRegistry
impl !UnwindSafe for CodecRegistry
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