Trait IKeFormatStorage

Source
pub trait IKeFormatStorage<'s>: Sized {
    type PartialConstruct;
    type ConstructionError: Display;
    type ValuesStorage<T>: AsMut<[T]> + AsRef<[T]>;

    // Required methods
    fn new_constructor(    ) -> IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>;
    fn add_segment(
        constructor: IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>,
        segment: Segment<'s>,
    ) -> IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>;
    fn segments(&self) -> &[Segment<'s>];
    fn segments_mut(&mut self) -> &mut [Segment<'s>];
    fn values_storage<T, F: FnMut(usize) -> T>(
        &self,
        f: F,
    ) -> Self::ValuesStorage<T>;

    // Provided methods
    fn segment(&self, id: &str) -> Option<&Segment<'s>> { ... }
    fn segment_mut(&mut self, id: &str) -> Option<&mut Segment<'s>> { ... }
}

Required Associated Types§

Required Methods§

Source

fn new_constructor() -> IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>

Source

fn add_segment( constructor: IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>, segment: Segment<'s>, ) -> IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>

Source

fn segments(&self) -> &[Segment<'s>]

Source

fn segments_mut(&mut self) -> &mut [Segment<'s>]

Source

fn values_storage<T, F: FnMut(usize) -> T>( &self, f: F, ) -> Self::ValuesStorage<T>

Provided Methods§

Source

fn segment(&self, id: &str) -> Option<&Segment<'s>>

Source

fn segment_mut(&mut self, id: &str) -> Option<&mut Segment<'s>>

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<'s> IKeFormatStorage<'s> for Vec<Segment<'s>>

Source§

type PartialConstruct = Infallible

Source§

type ConstructionError = Infallible

Source§

type ValuesStorage<T> = Box<[T]>

Source§

fn new_constructor() -> IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>

Source§

fn add_segment( constructor: IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>, segment: Segment<'s>, ) -> IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>

Source§

fn segments(&self) -> &[Segment<'s>]

Source§

fn segments_mut(&mut self) -> &mut [Segment<'s>]

Source§

fn values_storage<T, F: FnMut(usize) -> T>( &self, f: F, ) -> Self::ValuesStorage<T>

Source§

impl<'s, const N: usize> IKeFormatStorage<'s> for [Segment<'s>; N]

Source§

type PartialConstruct = ([MaybeUninit<Segment<'s>>; N], u16)

Source§

type ConstructionError = Box<dyn Error + Sync + Send>

Source§

type ValuesStorage<T> = [T; N]

Source§

fn new_constructor() -> IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>

Source§

fn add_segment( constructor: IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>, segment: Segment<'s>, ) -> IterativeConstructor<Self, Self::PartialConstruct, Self::ConstructionError>

Source§

fn segments(&self) -> &[Segment<'s>]

Source§

fn segments_mut(&mut self) -> &mut [Segment<'s>]

Source§

fn values_storage<T, F: FnMut(usize) -> T>( &self, f: F, ) -> Self::ValuesStorage<T>

Implementors§