Skip to main content

PortRxHub

Struct PortRxHub 

Source
pub struct PortRxHub { /* private fields */ }
Expand description

Single RX consumer on the main serial fd (desktop).

Implementations§

Source§

impl PortRxHub

Source

pub fn start(port: Arc<Mutex<Box<dyn SerialPort>>>, path: String) -> Self

Source

pub fn shared(&self) -> Arc<RxHubShared> ⓘ

Source

pub fn is_finished(&self) -> bool

Source

pub fn attach_watch_with( &self, channel: EventSink, batch_timeout_ms: u64, read_size: usize, route_urc: bool, framer: Option<Box<dyn Framer>>, )

Source

pub fn detach_watch(&self)

Source

pub fn set_exchange_waiter(&self, waiter: Arc<ExchangeWaiter>)

Source

pub fn clear_exchange_waiter(&self)

Source

pub fn cancel_active_exchange(&self)

Source

pub fn attach_cmux(&self, session: Arc<CmuxSession>)

Source

pub fn detach_cmux(&self)

Source

pub fn drain( &self, idle_ms: u64, max_ms: u64, cancel: Arc<AtomicBool>, solicited_prefixes: Vec<String>, ) -> Result<Vec<u8>, String>

Soft-drain via the hub thread (single reader); URC lines are emitted on the watch channel.

Source

pub fn request_stop(&self)

Source

pub fn stop(self)

Stop and join the hub thread (not when called from it, e.g. a watch sink closing its own port: then it only asks it to stop).

Trait Implementations§

Source§

impl RxHubHandle for PortRxHub

Source§

fn shared(&self) -> Arc<RxHubShared> ⓘ

Source§

fn set_exchange_waiter(&self, waiter: Arc<ExchangeWaiter>)

Source§

fn clear_exchange_waiter(&self)

Source§

fn cancel_active_exchange(&self)

Source§

fn attach_watch_with( &self, channel: EventSink, batch_timeout_ms: u64, read_size: usize, route_urc: bool, framer: Option<Box<dyn Framer>>, )

Source§

fn detach_watch(&self)

Source§

fn attach_cmux(&self, session: Arc<CmuxSession>)

Source§

fn detach_cmux(&self)

Source§

fn shutdown_hub(&self)

Stop background RX processing.

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> 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, 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.