Trait ChainConversions

Source
pub trait ChainConversions: Sized + ChainConversionsSealed {
    type Inner;
    type MutChain<'mut_chain>
       where Self: 'mut_chain;

    // Required methods
    fn as_inner(&self) -> &Self::Inner;
    fn as_inner_mut(&mut self) -> &mut Self::Inner;
    fn as_mut_chain(&mut self) -> Self::MutChain<'_>;
}
Expand description

Trait implemented on chains and their inner types, allowing you to get a reference to the inner type regardless of if the chain or the inner type is passed in

Required Associated Types§

Source

type Inner

Source

type MutChain<'mut_chain> where Self: 'mut_chain

Required Methods§

Source

fn as_inner(&self) -> &Self::Inner

Source

fn as_inner_mut(&mut self) -> &mut Self::Inner

Source

fn as_mut_chain(&mut self) -> Self::MutChain<'_>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> ChainConversions for &mut T

Source§

type Inner = <T as ChainConversions>::Inner

Source§

type MutChain<'mut_chain> = <T as ChainConversions>::MutChain<'mut_chain> where &mut T: 'mut_chain

Source§

fn as_inner(&self) -> &<&mut T as ChainConversions>::Inner

Source§

fn as_inner_mut(&mut self) -> &mut <&mut T as ChainConversions>::Inner

Source§

fn as_mut_chain(&mut self) -> <&mut T as ChainConversions>::MutChain<'_>

Source§

impl<T, const N: usize> ChainConversions for [T; N]

Source§

type Inner = [T; N]

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut [T; N]> where [T; N]: 'mut_chain

Source§

fn as_inner(&self) -> &<[T; N] as ChainConversions>::Inner

Source§

fn as_inner_mut(&mut self) -> &mut <[T; N] as ChainConversions>::Inner

Source§

fn as_mut_chain(&mut self) -> Chain<&mut [T; N]>

Implementors§

Source§

impl ChainConversions for String

Source§

type Inner = String

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut String> where String: 'mut_chain

Source§

impl ChainConversions for Chain<String>

Source§

type Inner = String

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut String> where Chain<String>: 'mut_chain

Source§

impl<'h> ChainConversions for Chain<&'h mut String>

Source§

type Inner = String

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut String> where Chain<&'h mut String>: 'mut_chain

Source§

impl<'h, T> ChainConversions for Chain<&'h mut Vec<T>>

Source§

type Inner = Vec<T>

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut Vec<T>> where Chain<&'h mut Vec<T>>: 'mut_chain

Source§

impl<'h, T, const N: usize> ChainConversions for Chain<&'h mut [T; N]>

Source§

type Inner = [T; N]

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut [T; N]> where Chain<&'h mut [T; N]>: 'mut_chain

Source§

impl<T> ChainConversions for Vec<T>

Source§

type Inner = Vec<T>

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut Vec<T>> where Vec<T>: 'mut_chain

Source§

impl<T> ChainConversions for Chain<Vec<T>>

Source§

type Inner = Vec<T>

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut Vec<T>> where Chain<Vec<T>>: 'mut_chain

Source§

impl<T, const N: usize> ChainConversions for Chain<[T; N]>

Source§

type Inner = [T; N]

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut [T; N]> where Chain<[T; N]>: 'mut_chain