pub struct CodecRegistry { /* private fields */ }Implementations§
Source§impl CodecRegistry
impl CodecRegistry
pub fn new_empty() -> CodecRegistry
pub fn new_preloaded() -> CodecRegistry
pub fn register<C>(&mut self, kind: CodecKind, codec: C)where
C: Codec + 'static,
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 !RefUnwindSafe for CodecRegistry
impl !UnwindSafe for CodecRegistry
impl Freeze for CodecRegistry
impl Send for CodecRegistry
impl Sync for CodecRegistry
impl Unpin for CodecRegistry
impl UnsafeUnpin 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