pub struct Remainder;Expand description
Reads/writes all remaining bytes without a length prefix.
Useful for fields that should consume the remainder of the input.
§Example
use defuse_borsh_utils::{As, Remainder};
use borsh::{BorshSerialize, BorshDeserialize};
#[derive(BorshSerialize, BorshDeserialize)]
struct S {
#[borsh(
serialize_with = "As::<Remainder>::serialize",
deserialize_with = "As::<Remainder>::deserialize"
)]
pub data: Vec<u8>,
}Trait Implementations§
Source§impl<T> BorshDeserializeAs<T> for Remainder
impl<T> BorshDeserializeAs<T> for Remainder
Auto Trait Implementations§
impl Freeze for Remainder
impl RefUnwindSafe for Remainder
impl Send for Remainder
impl Sync for Remainder
impl Unpin for Remainder
impl UnsafeUnpin for Remainder
impl UnwindSafe for Remainder
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