Trait ChainConversions

Source
pub trait ChainConversions
where Self: Sized + ChainConversionsSealed,
{ type Inner: Sized; type MutChain<'mut_chain>: Sized 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: Sized

Source

type MutChain<'mut_chain>: Sized 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 ChainConversions for String

Source§

type Inner = String

Source§

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

Source§

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

Source§

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

Source§

fn as_mut_chain(&mut self) -> Chain<&mut String>

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 Self: 'mut_chain

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<'_>

Source§

impl<T> ChainConversions for Vec<T>

Source§

type Inner = Vec<T>

Source§

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

Source§

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

Source§

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

Source§

fn as_mut_chain(&mut self) -> Chain<&mut Vec<T>>

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 Self: 'mut_chain

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl ChainConversions for Chain<String>

Source§

type Inner = String

Source§

type MutChain<'mut_chain> = Chain<&'mut_chain mut String> where Self: '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 Self: '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 Self: '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 Self: '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 Self: '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 Self: 'mut_chain