Skip to main content

MRef

Enum MRef 

Source
pub enum MRef<'a, T> {
    Ref(&'a T),
    Owned(T),
}

Variants§

§

Ref(&'a T)

§

Owned(T)

Implementations§

Source§

impl<T> MRef<'_, T>
where T: Clone,

Source

pub fn get_or_clone(self) -> T

Trait Implementations§

Source§

impl<T> AsRef<T> for MRef<'_, T>

Source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T> Deref for MRef<'_, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<'a, T> From<&'a T> for MRef<'a, T>

Source§

fn from(value: &'a T) -> Self

Converts to this type from the input type.
Source§

impl<T> From<T> for MRef<'_, T>

Source§

fn from(value: T) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a, T> Freeze for MRef<'a, T>
where T: Freeze,

§

impl<'a, T> RefUnwindSafe for MRef<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for MRef<'a, T>
where T: Send + Sync,

§

impl<'a, T> Sync for MRef<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for MRef<'a, T>
where T: Unpin,

§

impl<'a, T> UnsafeUnpin for MRef<'a, T>
where T: UnsafeUnpin,

§

impl<'a, T> UnwindSafe for MRef<'a, T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Builder, Source, Output> CanBuildFrom<Source> for Builder
where Source: HasFields + IntoBuilder, <Source as HasFields>::Fields: FieldsBuilder<<Source as IntoBuilder>::Builder, Builder, Output = Output>,

Source§

type Output = Output

Source§

fn build_from(self, source: Source) -> Output

Source§

impl<Source, Target, Remainder> CanDowncastFields<Target> for Source
where Target: HasFields, <Target as HasFields>::Fields: FieldsExtractor<Source, Target, Remainder = Remainder>,

Source§

type Remainder = Remainder

Source§

fn downcast_fields( self, _tag: PhantomData<Target>, ) -> Result<Target, <Source as CanDowncastFields<Target>>::Remainder>

Source§

impl<T> From<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<Context, Tag, Target, Value> HasField<Tag> for Context
where Context: DerefMap<Target = Target>, Target: HasField<Tag, Value = Value>,

Source§

type Value = Value

Source§

fn get_field(&self, tag: PhantomData<Tag>) -> &<Context as HasField<Tag>>::Value

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Context, Tag> MapField<Tag> for Context
where Context: HasField<Tag>, Tag: 'static,

Source§

fn map_field<T>( &self, tag: PhantomData<Tag>, mapper: impl for<'a> FnOnce(&'a <Context as HasField<Tag>>::Value) -> &'a T, ) -> &T

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.