Skip to main content

TryFromBuffer

Trait TryFromBuffer 

Source
pub trait TryFromBuffer<T>: Sized {
    // Required method
    fn try_from_buffer(value: T) -> Result<Self, BufferOverflow>;
}
Expand description

Allow messages to convert between different backing buffers with the possibility of overflow.

If a buffer A implements TryFromBuffer<B> then messages backed by A can created from messages backed by B with the TryRebufferFrom trait.

For more info see the buffer module docs.

Required Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<const SIZE: usize, U: Unit> TryFromBuffer<&[U]> for [U; SIZE]

Source§

impl<const SIZE: usize, U: Unit> TryFromBuffer<&mut [U]> for [U; SIZE]

Source§

impl<const SIZE: usize, U: Unit> TryFromBuffer<Vec<U>> for [U; SIZE]

Available on crate features std only.

Implementors§