#[non_exhaustive]pub enum Command {
CancelReservation(CancelReservation),
ReserveNow(Box<ReserveNow>),
StartSession(Box<StartSession>),
StopSession(StopSession),
UnlockConnector(UnlockConnector),
}Available on crate feature
v2_3_0 only.Expand description
Every command body, tagged by the CommandType it belongs to.
The wire format is one POST per command with the command name in the URL, so this enum is not itself serialised as a tagged union; it exists so a server handler can take one argument and a client can queue heterogeneous commands.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
CancelReservation(CancelReservation)
POST {commands_endpoint}/CANCEL_RESERVATION
ReserveNow(Box<ReserveNow>)
POST {commands_endpoint}/RESERVE_NOW
StartSession(Box<StartSession>)
POST {commands_endpoint}/START_SESSION
StopSession(StopSession)
POST {commands_endpoint}/STOP_SESSION
UnlockConnector(UnlockConnector)
POST {commands_endpoint}/UNLOCK_CONNECTOR
Implementations§
Source§impl Command
impl Command
Sourcepub fn command_type(&self) -> CommandType
pub fn command_type(&self) -> CommandType
Which command this is.
Sourcepub fn response_url(&self) -> &Url
pub fn response_url(&self) -> &Url
The URL the CommandResult must be POSTed to.
Trait Implementations§
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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
Mutably borrows from an owned value. Read more