pub enum PtyEvent {
Output(Vec<u8>),
Exit(PtyExitStatus),
Error(String),
}Expand description
Event delivered asynchronously by a PTY session.
Ordering is backend enqueue order. In the portable backend, output batching and child waiting run on separate threads, so an exit event is not guaranteed to follow the final output batch. Payloads are unbounded by the model and are neither parsed nor redacted.
§Examples
use ailloli_ui_terminal_pty::{PtyEvent, PtyExitStatus};
let events = vec![PtyEvent::Output(b"ok".to_vec()), PtyEvent::Exit(PtyExitStatus::success(0))];
assert!(matches!(&events[0], PtyEvent::Output(bytes) if bytes == b"ok"));Variants§
Output(Vec<u8>)
Raw output bytes; the vector may be empty and may contain invalid UTF-8.
Exit(PtyExitStatus)
Child completion metadata.
Error(String)
Asynchronous backend error text, stored verbatim without categorization.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PtyEvent
impl<'de> Deserialize<'de> for PtyEvent
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PtyEvent
impl StructuralPartialEq for PtyEvent
Auto Trait Implementations§
impl Freeze for PtyEvent
impl RefUnwindSafe for PtyEvent
impl Send for PtyEvent
impl Sync for PtyEvent
impl Unpin for PtyEvent
impl UnwindSafe for PtyEvent
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.