pub struct MissionControl { /* private fields */ }Expand description
One operator control, as Universal Exports hands it to the Station holding the Mission.
The Station is the authority: it checks the Mission, the Operation and its own Run lease before acting, and reports the outcome back.
Implementations§
Source§impl MissionControl
impl MissionControl
Sourcepub fn new(
control_id: ControlId,
operation_id: OperationId,
mission_id: MissionId,
action: ControlAction,
) -> Self
pub fn new( control_id: ControlId, operation_id: OperationId, mission_id: MissionId, action: ControlAction, ) -> Self
A control with no Run, Agent or message.
Sourcepub fn with_run(self, run_id: RunId) -> Self
pub fn with_run(self, run_id: RunId) -> Self
Names the Run the control expects to be the Mission’s current one.
Sourcepub fn with_agent(
self,
agent: impl Into<String>,
) -> Result<Self, InvalidControl>
pub fn with_agent( self, agent: impl Into<String>, ) -> Result<Self, InvalidControl>
Names the Agent a retry is given to.
§Errors
InvalidControl for an empty codename, one over MAX_ID_BYTES or one with
control characters.
Sourcepub fn with_message(
self,
message: impl Into<String>,
) -> Result<Self, InvalidControl>
pub fn with_message( self, message: impl Into<String>, ) -> Result<Self, InvalidControl>
Adds the message a resume sends to the Agent.
§Errors
InvalidControl for a blank message or one over MAX_CONTROL_MESSAGE_BYTES.
Sourcepub fn control_id(&self) -> &ControlId
pub fn control_id(&self) -> &ControlId
The control’s identity, unique per request.
Sourcepub fn operation_id(&self) -> &OperationId
pub fn operation_id(&self) -> &OperationId
The Operation the requester was authorized for.
Sourcepub fn mission_id(&self) -> &MissionId
pub fn mission_id(&self) -> &MissionId
The Mission the control acts on.
Sourcepub fn run_id(&self) -> Option<&RunId>
pub fn run_id(&self) -> Option<&RunId>
The Run expected to be the Mission’s current one, when known.
Sourcepub const fn action(&self) -> ControlAction
pub const fn action(&self) -> ControlAction
What the operator asked for.
Trait Implementations§
Source§impl Clone for MissionControl
impl Clone for MissionControl
Source§impl Debug for MissionControl
impl Debug for MissionControl
impl Eq for MissionControl
Source§impl PartialEq for MissionControl
impl PartialEq for MissionControl
impl StructuralPartialEq for MissionControl
Auto Trait Implementations§
impl Freeze for MissionControl
impl RefUnwindSafe for MissionControl
impl Send for MissionControl
impl Sync for MissionControl
impl Unpin for MissionControl
impl UnsafeUnpin for MissionControl
impl UnwindSafe for MissionControl
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.