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

pub struct BorrowingRCowStr<'a> {
    pub cow: RCow<'a, str>,
}

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

Example

Defining a type containing an RCow<'a,str> borrowing from the deserializer, serializing it, and then deserializing it.

use abi_stable::std_types::cow::{
    deserialize_borrowed_str,
    BorrowingRCowStr,
};


let json=r##""W____ of S____""##;

let deserialized_slice=serde_json::from_str::<BorrowingRCowStr<'_>>(json).unwrap();

assert_eq!( &*deserialized_slice.cow, json.trim_matches('"') );

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

Fields

cow: RCow<'a, str>

Trait Implementations

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

Auto Trait Implementations

impl<'a> Send for BorrowingRCowStr<'a>

impl<'a> Sync for BorrowingRCowStr<'a>

impl<'a> Unpin for BorrowingRCowStr<'a>

impl<'a> UnwindSafe for BorrowingRCowStr<'a>

impl<'a> RefUnwindSafe for BorrowingRCowStr<'a>

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]