Skip to main content

PointInput

Trait PointInput 

Source
pub trait PointInput: ParseInput {
    type Extra: 'static + Clone;
    type WithExtra<E: 'static + Clone>: PointInput<Extra = E, WithExtra<Self::Extra> = Self>;

    // Required methods
    fn next_index(&mut self) -> usize;
    fn resolve_arc_ref(&self) -> &Arc<dyn Resolve>;
    fn extra(&self) -> &Self::Extra;
    fn map_extra<E: 'static + Clone>(
        self,
        f: impl FnOnce(&Self::Extra) -> &E,
    ) -> Self::WithExtra<E>;
    fn replace_extra<E: 'static + Clone>(
        self,
        extra: E,
    ) -> (Self::Extra, Self::WithExtra<E>);
    fn parse_inline_extra<E: 'static + Clone, T: ParseInline<Self::WithExtra<E>>>(
        &mut self,
        extra: E,
    ) -> Result<T>;

    // Provided methods
    fn resolve(&self) -> Arc<dyn Resolve> { ... }
    fn resolve_ref(&self) -> &dyn Resolve { ... }
    fn with_extra<E: 'static + Clone>(self, extra: E) -> Self::WithExtra<E> { ... }
    fn parse_extra<E: 'static + Clone, T: Parse<Self::WithExtra<E>>>(
        self,
        extra: E,
    ) -> Result<T> { ... }
}

Required Associated Types§

Source

type Extra: 'static + Clone

Source

type WithExtra<E: 'static + Clone>: PointInput<Extra = E, WithExtra<Self::Extra> = Self>

Required Methods§

Source

fn next_index(&mut self) -> usize

Source

fn resolve_arc_ref(&self) -> &Arc<dyn Resolve>

Source

fn extra(&self) -> &Self::Extra

Source

fn map_extra<E: 'static + Clone>( self, f: impl FnOnce(&Self::Extra) -> &E, ) -> Self::WithExtra<E>

Project the Extra. Under some circumstances, prevents an extra Clone::clone.

Source

fn replace_extra<E: 'static + Clone>( self, extra: E, ) -> (Self::Extra, Self::WithExtra<E>)

Return the old Self::Extra, give a new PointInput with E as Extra.

Source

fn parse_inline_extra<E: 'static + Clone, T: ParseInline<Self::WithExtra<E>>>( &mut self, extra: E, ) -> Result<T>

ParseInput::parse_inline with a different Extra.

Provided Methods§

Source

fn resolve(&self) -> Arc<dyn Resolve>

Source

fn resolve_ref(&self) -> &dyn Resolve

Source

fn with_extra<E: 'static + Clone>(self, extra: E) -> Self::WithExtra<E>

Source

fn parse_extra<E: 'static + Clone, T: Parse<Self::WithExtra<E>>>( self, extra: E, ) -> Result<T>

ParseInput::parse with a different Extra.

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.

Implementors§

Source§

impl<'d, Extra: 'static + Clone> PointInput for Input<'d, Extra>

Source§

type Extra = Extra

Source§

type WithExtra<E: 'static + Clone> = Input<'d, E>