Skip to main content

VisitCallbacks

Struct VisitCallbacks 

Source
pub struct VisitCallbacks<State, Link, Marker> { /* private fields */ }
Expand description

A reusable callback visitor with shared user state.

Implementations§

Source§

impl<State, Link, Marker> VisitCallbacks<State, Link, Marker>
where Link: VisitChainLink<State, Marker>,

Source

pub fn new(state: State, callbacks: Link) -> Self

Construct a stateful callback visitor.

Source§

impl<State, Link, Marker> VisitCallbacks<State, Link, Marker>

Source

pub fn state(&self) -> &State

Shared access to the callback state.

Source

pub fn state_mut(&mut self) -> &mut State

Mutable access to the callback state outside an active recursive call.

Source

pub fn into_state(self) -> State

Consume the visitor and return its state.

Trait Implementations§

Source§

impl<State, Link, Marker> StructuralVisitor for VisitCallbacks<State, Link, Marker>
where Link: VisitChainLink<State, Marker>,

Source§

fn visit( &mut self, value: &VisitValue, def_region_kind: DefRegionKind, ) -> Result<Option<VisitInterrupt>>

Visit one value under the definition-region state active at it.
Source§

fn visit_child<T>( &mut self, child: &T, def_region_kind: DefRegionKind, ) -> Result<Option<VisitInterrupt>>
where for<'x> AnyView<'x>: From<&'x T>,

Visit child under def_region_kind.
Source§

fn default_visit_children( &mut self, value: &VisitValue, def_region_kind: DefRegionKind, ) -> Result<Option<VisitInterrupt>>

Visit value’s children with the default structural rules.

Auto Trait Implementations§

§

impl<State, Link, Marker> !Send for VisitCallbacks<State, Link, Marker>

§

impl<State, Link, Marker> !Sync for VisitCallbacks<State, Link, Marker>

§

impl<State, Link, Marker> Freeze for VisitCallbacks<State, Link, Marker>
where State: Freeze,

§

impl<State, Link, Marker> RefUnwindSafe for VisitCallbacks<State, Link, Marker>
where State: RefUnwindSafe, Link: RefUnwindSafe,

§

impl<State, Link, Marker> Unpin for VisitCallbacks<State, Link, Marker>
where State: Unpin,

§

impl<State, Link, Marker> UnsafeUnpin for VisitCallbacks<State, Link, Marker>
where State: UnsafeUnpin,

§

impl<State, Link, Marker> UnwindSafe for VisitCallbacks<State, Link, Marker>
where State: UnwindSafe, Link: RefUnwindSafe,

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<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.