[][src]Struct abi_stable::std_types::cow::BorrowingRCowU8Slice

pub struct BorrowingRCowU8Slice<'a> {
    pub cow: RCow<'a, [u8]>,
}

A helper type,to deserialize a RCow<'a,u8> which borrows from the deserializer.

Example

use abi_stable::std_types::cow::{
    deserialize_borrowed_bytes,
    BorrowingRCowU8Slice,
};


let the_slice:Vec<u8>=vec![0,1,2,3,4,5];

let vec=bincode::serialize(&the_slice).unwrap();

let deserialized_slice=bincode::deserialize::<BorrowingRCowU8Slice<'_>>(&vec).unwrap();

assert_eq!( &*deserialized_slice.cow, &*the_slice );

assert!( deserialized_slice.cow.is_borrowed() );

Fields

cow: RCow<'a, [u8]>

Trait Implementations

impl<'de: 'a, 'a> Deserialize<'de> for BorrowingRCowU8Slice<'a>[src]

Auto Trait Implementations

Blanket Implementations

impl<This> TransmuteElement for This where
    This: ?Sized
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> TypeIdentity for T where
    T: ?Sized
[src]

type Type = T

The same type as Self. Read more

impl<T> SelfOps for T where
    T: ?Sized
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The error type returned when the conversion fails.

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]