Trait valence::nbt::compound::AsBorrowed

pub trait AsBorrowed<S> {
    type Borrowed: ?Sized;

    // Required method
    fn as_borrowed(&self) -> &Self::Borrowed;
}
Expand description

Trait that can be used as a key to query a compound. Basically something that can be converted to a type B such that S: Borrow<B>.

Required Associated Types§

Required Methods§

fn as_borrowed(&self) -> &Self::Borrowed

Implementors§

§

impl<'a, Q> AsBorrowed<Cow<'a, str>> for Q
where Cow<'a, str>: Borrow<Q>, Q: ?Sized,

§

type Borrowed = Q

§

impl<Q> AsBorrowed<Cow<'_, JavaStr>> for Q
where &'a Q: for<'a> Into<&'a JavaStr>, Q: ?Sized,

§

type Borrowed = JavaStr

§

impl<Q> AsBorrowed<String> for Q
where String: Borrow<Q>, Q: ?Sized,

§

type Borrowed = Q

§

impl<Q> AsBorrowed<JavaString> for Q
where &'a Q: for<'a> Into<&'a JavaStr>, Q: ?Sized,

§

type Borrowed = JavaStr