spirt::func_at

Struct FuncAtMut

Source
pub struct FuncAtMut<'a, P: Copy> {
    pub control_regions: &'a mut EntityDefs<ControlRegion>,
    pub control_nodes: &'a mut EntityDefs<ControlNode>,
    pub data_insts: &'a mut EntityDefs<DataInst>,
    pub position: P,
}
Expand description

Mutable traversal (i.e. transforming) helper for intra-function entities.

The point/position type P should be an entity or a shallow entity wrapper (e.g. EntityList<ControlNode>).

Fields§

§control_regions: &'a mut EntityDefs<ControlRegion>§control_nodes: &'a mut EntityDefs<ControlNode>§data_insts: &'a mut EntityDefs<DataInst>§position: P

Implementations§

Source§

impl<'a, P: Copy> FuncAtMut<'a, P>

Source

pub fn reborrow(&mut self) -> FuncAtMut<'_, P>

Emulate a “reborrow”, which is automatic only for &mut types.

Source

pub fn at<P2: Copy>(self, new_position: P2) -> FuncAtMut<'a, P2>

Reposition to new_position.

Source

pub fn freeze(self) -> FuncAt<'a, P>

Demote to a FuncAt, with the same position.

Source§

impl<'a> FuncAtMut<'a, ControlRegion>

Source

pub fn def(self) -> &'a mut ControlRegionDef

Source

pub fn at_children(self) -> FuncAtMut<'a, EntityList<ControlNode>>

Source§

impl<'a> FuncAtMut<'a, EntityList<ControlNode>>

Source§

impl FuncAtMut<'_, EntityListIter<ControlNode>>

Source

pub fn next(&mut self) -> Option<FuncAtMut<'_, ControlNode>>

Source§

impl<'a> FuncAtMut<'a, ControlNode>

Source

pub fn def(self) -> &'a mut ControlNodeDef

Source§

impl<'a> FuncAtMut<'a, EntityList<DataInst>>

Source§

impl FuncAtMut<'_, EntityListIter<DataInst>>

Source

pub fn next(&mut self) -> Option<FuncAtMut<'_, DataInst>>

Source§

impl<'a> FuncAtMut<'a, DataInst>

Source

pub fn def(self) -> &'a mut DataInstDef

Trait Implementations§

Auto Trait Implementations§

§

impl<'a, P> Freeze for FuncAtMut<'a, P>
where P: Freeze,

§

impl<'a, P> RefUnwindSafe for FuncAtMut<'a, P>
where P: RefUnwindSafe,

§

impl<'a, P> Send for FuncAtMut<'a, P>
where P: Send,

§

impl<'a, P> Sync for FuncAtMut<'a, P>
where P: Sync,

§

impl<'a, P> Unpin for FuncAtMut<'a, P>
where P: Unpin,

§

impl<'a, P> !UnwindSafe for FuncAtMut<'a, P>

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.