Enum livemod::ActionTarget [−][src]
Expand description
The target of a method call on a LiveMod
variable.
Variants
The variable itself.
A field of the variable.
Implementations
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"]))));