Skip to main content

OperatorGateState

Struct OperatorGateState 

Source
pub struct OperatorGateState {
    pub kind: OperatorGateKind,
    pub subject: OperatorGateSubject,
    pub input: OperatorGateInput,
    pub options: Vec<OperatorGateOption>,
}
Expand description

The full classification of a screen recognized as an OperatorGate, replacing what used to be a bare label string. kind is always known (a matcher only returns this type once it has matched a specific gate phrase); subject, input, and options degrade independently to Unknown/empty when the screen’s specific shape was not recognized – never invented from kind alone.

Fields§

§kind: OperatorGateKind§subject: OperatorGateSubject§input: OperatorGateInput§options: Vec<OperatorGateOption>

Recognized on-screen choices, in on-screen order. Empty means no option list was recognized – NOT that the screen has no choices; see OperatorGateInput::Unknown for the paired “input mechanism unrecognized either” case.

Implementations§

Source§

impl OperatorGateState

Source

pub fn new(kind: OperatorGateKind) -> Self

The gate with nothing known past kind – subject: Unknown, input: Unknown, no options. This is the honest shape for a matched kind whose screen a parser has not (yet) learned to read past the phrase that identified it; never upgrade an unread screen into a guessed subject or option list.

Source

pub fn with_subject(self, subject: OperatorGateSubject) -> Self

Builder-style: attach a recognized subject.

Source

pub fn with_options( self, input: OperatorGateInput, options: Vec<OperatorGateOption>, ) -> Self

Builder-style: attach a recognized input mechanism and its options together, since one is meaningless without the other (an Unknown input never carries options, and options never accompany an unrecognized input mechanism).

Source

pub fn is_valid(&self) -> bool

Bounds check matching PtyScreenState::is_valid’s own rationale – every string this type carries travels over the wire into an operator UI and must be non-empty (where required), control-character free, and within its per-field byte cap before anything downstream trusts it.

Source§

impl OperatorGateState

Source

pub fn describe(&self) -> String

Longer operator-facing rendering than Display: the kind label, plus a compact list of recognized options (currently-selected one prefixed *) when options is non-empty. Display stays kind-only on purpose (see its own doc comment) – this is for a surface that can afford, and wants, the fuller picture once one was parsed.

Trait Implementations§

Source§

impl Clone for OperatorGateState

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OperatorGateState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for OperatorGateState

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for OperatorGateState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Renders as kind.label() alone – the same text this whole type replaced used to carry as its only payload – so an existing format!("...{gate}...") call site keeps reading the same message after this type lands under it.

Source§

impl Eq for OperatorGateState

Source§

impl PartialEq for OperatorGateState

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for OperatorGateState

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for OperatorGateState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.