Skip to main content

Walk

Struct Walk 

Source
pub struct Walk<L: Lang> {
    pub ids: Vec<L::Id>,
    pub root: L::Id,
    /* private fields */
}
Expand description

先序遍历的快照:id 列表 + 每个非根节点的 (parent, child_index)。

快照在遍历时一次性取出;之后 apply 编辑不影响本次快照的正确性 (arena 追加式,Id 永不失效;被改动节点的旧信息由“命中即重启扫描”策略规避)。

Fields§

§ids: Vec<L::Id>§root: L::Id

Implementations§

Source§

impl<L: Lang> Walk<L>

Source

pub fn parent(&self, id: L::Id) -> Option<L::Id>

Source

pub fn index(&self, id: L::Id) -> Option<usize>

Auto Trait Implementations§

§

impl<L> Freeze for Walk<L>
where Vec<<L as Lang>::Id>: Freeze, HashMap<<L as Lang>::Id, (<L as Lang>::Id, usize), BuildHasherDefault<IdHasher>>: Freeze, <L as Lang>::Id: Freeze,

§

impl<L> RefUnwindSafe for Walk<L>

§

impl<L> Send for Walk<L>
where Vec<<L as Lang>::Id>: Send, HashMap<<L as Lang>::Id, (<L as Lang>::Id, usize), BuildHasherDefault<IdHasher>>: Send, <L as Lang>::Id: Send,

§

impl<L> Sync for Walk<L>
where Vec<<L as Lang>::Id>: Sync, HashMap<<L as Lang>::Id, (<L as Lang>::Id, usize), BuildHasherDefault<IdHasher>>: Sync, <L as Lang>::Id: Sync,

§

impl<L> Unpin for Walk<L>
where Vec<<L as Lang>::Id>: Unpin, HashMap<<L as Lang>::Id, (<L as Lang>::Id, usize), BuildHasherDefault<IdHasher>>: Unpin, <L as Lang>::Id: Unpin,

§

impl<L> UnsafeUnpin for Walk<L>
where Vec<<L as Lang>::Id>: UnsafeUnpin, HashMap<<L as Lang>::Id, (<L as Lang>::Id, usize), BuildHasherDefault<IdHasher>>: UnsafeUnpin, <L as Lang>::Id: UnsafeUnpin,

§

impl<L> UnwindSafe for Walk<L>
where Vec<<L as Lang>::Id>: UnwindSafe, HashMap<<L as Lang>::Id, (<L as Lang>::Id, usize), BuildHasherDefault<IdHasher>>: UnwindSafe, <L as Lang>::Id: UnwindSafe,

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.