Enum livemod::ActionTarget[][src]

pub enum ActionTarget<'a, 'b> {
    This,
    Field(&'a [&'b str]),
}
Expand description

The target of a method call on a LiveMod variable.

Variants

This

The variable itself.

Field(&'a [&'b str])

A field of the variable.

Tuple Fields of Field

0: &'a [&'b str]

Implementations

Returns true if the action_target is [This].

Create an ActionTarget by stripping the first element off the given slice.

assert_eq!(ActionTarget::from_name_and_fields(["foo"]), ActionTarget::This);
assert_eq!(ActionTarget::from_name_and_fields(["foo", "bar"]), ActionTarget::Field(&["bar"]));

If this is a ActionTarget::Field, return the topmost field name and the ActionTarget to use when calling the field. Otherwise, return None.

assert_eq!(ActionTarget::This.strip_one_field(), None);
assert_eq!(ActionTarget::Field(&["foo"]).strip_one_field(), Some(("foo", ActionTarget::This)));
assert_eq!(ActionTarget::Field(&["foo", "bar"]).strip_one_field(), Some(("foo", ActionTarget::Field(&["bar"]))));

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.