pub enum IOInput {
Line {
text: String,
context: InputContext,
},
Signal(SignalKind),
Eof,
}Expand description
Input from View layer to Bridge layer.
Represents raw user input before conversion to internal events.
§Variants
Line: Raw text input with context from View layerSignal: Pre-parsed control signal (e.g., Ctrl+C → Veto)Eof: End of input stream (disconnect, stdin closed)
Variants§
Line
Raw text line from user with View context.
The line is trimmed but not parsed. The context contains UI state from the View layer.
Fields
§
context: InputContextContext from View layer (e.g., current approval ID).
Signal(SignalKind)
Pre-parsed signal from View layer.
Used when the View layer can directly detect signals (e.g., terminal Ctrl+C handler).
Eof
End of input stream.
Indicates the input source has closed (EOF, disconnect).
Implementations§
Source§impl IOInput
impl IOInput
Sourcepub fn line_with_context(text: impl Into<String>, context: InputContext) -> Self
pub fn line_with_context(text: impl Into<String>, context: InputContext) -> Self
Creates a Line input with context.
Sourcepub fn signal(kind: SignalKind) -> Self
pub fn signal(kind: SignalKind) -> Self
Creates a Signal input.
Sourcepub fn context(&self) -> Option<&InputContext>
pub fn context(&self) -> Option<&InputContext>
Returns the context if this is a Line input.
Sourcepub fn approval_id(&self) -> Option<&str>
pub fn approval_id(&self) -> Option<&str>
Returns the approval ID from context if available.
Trait Implementations§
impl Eq for IOInput
impl StructuralPartialEq for IOInput
Auto Trait Implementations§
impl Freeze for IOInput
impl RefUnwindSafe for IOInput
impl Send for IOInput
impl Sync for IOInput
impl Unpin for IOInput
impl UnsafeUnpin for IOInput
impl UnwindSafe for IOInput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.