pub enum Action {
Show 19 variants
Create(VesselRequest),
Become(VesselRequest),
Enter(VesselRequest),
Leave,
Take(VesselRequest),
Drop(VesselRequest),
Move {
object_article: Option<Article>,
object_name: String,
preposition: IntoPrep,
target_article: Option<Article>,
target_name: String,
},
Look {
preposition: Option<AtPrep>,
basic: Option<VesselRequest>,
},
Transform {
preposition: Option<IntoPrep>,
basic: VesselRequest,
},
Note {
text: Option<String>,
},
Warp {
preposition: Option<IntoPrep>,
basic: VesselRequest,
},
Program(Option<VesselRequest>),
Use(VesselRequest),
Cast {
spell: VesselRequest,
preposition: OnPrep,
target: VesselRequest,
},
Save {
filename: Option<String>,
},
Load {
filename: Option<String>,
},
Debug,
Exit,
Learn {
preposition: Option<AboutPrep>,
topic: Option<Verb>,
},
}Expand description
An action to be executed by the system interface.
Variants§
Create(VesselRequest)
Creates a new vessel adjacent to the user’s.
Become(VesselRequest)
Takes control of an adjacent vessel.
Enter(VesselRequest)
Moves the controlled vessel into an adjacent vessel.
Leave
Moves the controlled vessel out of its parent, into its parent’s parent.
Take(VesselRequest)
Moves an adjacent vessel into the controlled vessel.
Drop(VesselRequest)
Moves a vessel inside the controlled vessel into the controlled vessel’s parent.
Move
Moves an adjacent vessel into another adjacent vessel.
Fields
preposition: IntoPrepThe preposition separating the two crate::vessel::Vessels.
Look
Displays a list of the adjacent vessels, or of the vessels inside an adjacent vessel.
Fields
preposition: Option<AtPrep>An optional preposition before the crate::vessel::Vessel being specified.
basic: Option<VesselRequest>An optional set of identifiers for a crate::vessel::Vessel to look at/inside.
Transform
Renames the controlled vessel.
Fields
preposition: Option<IntoPrep>An optional preposition before the crate::vessel::Vessel being specified.
basic: VesselRequestA set of identifiers for the crate::vessel::Vessel’s new name and Article.
Note
Assigns a description to the parent of the controlled vessel.
Warp
Moves the controlled vessel into another vessel, regardless of adjacency.
Fields
preposition: Option<IntoPrep>An optional preposition before the crate::vessel::Vessel being specified.
basic: VesselRequestA set of identifiers for the crate::vessel::Vessel being moved to.
Program(Option<VesselRequest>)
Begins programming a task for an adjacent vessel.
Use(VesselRequest)
Executes an adjacent vessel’s program.
Cast
Executes a distant vessel’s program as another vessel.
Fields
spell: VesselRequestA set of identifiers for the crate::vessel::Vessel whose program should be run.
preposition: OnPrepThe preposition separating the two crate::vessel::Vessels.
target: VesselRequestA set of identifiers for the crate::vessel::Vessel for the program to run as.
Save
Saves the state of all vessels to a file.
Load
Loads the state of all vessels from a file.
Debug
Displays the state of all vessels as raw json data.
Exit
Exits parade, or stops programming a vessel if the user is doing so.
Learn
Displays general information on Parade, or information on a specific action.
Implementations§
Source§impl Action
impl Action
Sourcepub fn from_vessel_request(
verb: Verb,
basic: VesselRequest,
) -> Result<Self, Error>
pub fn from_vessel_request( verb: Verb, basic: VesselRequest, ) -> Result<Self, Error>
Wraps a VesselRequest in an Action, if the Verb refers to an Action that wraps a VesselRequest.
§Errors
This method fails if the Verb refers to an Action which does not exclusively wrap a VesselRequest. The viable Verbs are:
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Action
impl<'de> Deserialize<'de> for Action
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Action
Source§impl Ord for Action
impl Ord for Action
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Action
impl PartialOrd for Action
impl StructuralPartialEq for Action
Auto Trait Implementations§
impl Freeze for Action
impl RefUnwindSafe for Action
impl Send for Action
impl Sync for Action
impl Unpin for Action
impl UnsafeUnpin for Action
impl UnwindSafe for Action
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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