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§
fn try_from_buffer(value: T) -> Result<Self, BufferOverflow>
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]
impl<const SIZE: usize, U: Unit> TryFromBuffer<&[U]> for [U; SIZE]
fn try_from_buffer(value: &[U]) -> Result<Self, BufferOverflow>
Source§impl<const SIZE: usize, U: Unit> TryFromBuffer<&mut [U]> for [U; SIZE]
impl<const SIZE: usize, U: Unit> TryFromBuffer<&mut [U]> for [U; SIZE]
fn try_from_buffer(value: &mut [U]) -> Result<Self, BufferOverflow>
Source§impl<const SIZE: usize, U: Unit> TryFromBuffer<Vec<U>> for [U; SIZE]
Available on crate features std only.
impl<const SIZE: usize, U: Unit> TryFromBuffer<Vec<U>> for [U; SIZE]
Available on crate features
std only.