Skip to main content

AsyncDevice

Struct AsyncDevice 

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

An asynchronous version of Device.

As this is simply an asynchronous interface for the standard Device struct, refer to the documentation there for information about the individual methods.

Implementations§

Source§

impl AsyncDevice

Source

pub async fn open(path: impl AsRef<Path>) -> Result<AsyncDevice>

Source

pub async fn set_blocking(&self, blocking: bool) -> Result<()>

Source

pub async fn get_poller(&self) -> Result<AsyncDevicePoller>

Source

pub async fn poll(&self, timeout: PollTimeout) -> Result<Vec<PollResult>>

Source

pub async fn get_initiator_mode(&self) -> Result<InitiatorMode>

Source

pub async fn set_initiator_mode(&self, mode: InitiatorMode) -> Result<()>

Source

pub async fn get_follower_mode(&self) -> Result<FollowerMode>

Source

pub async fn set_follower_mode(&self, mode: FollowerMode) -> Result<()>

Source

pub async fn get_capabilities(&self) -> Result<Capabilities>

Source

pub async fn get_raw_capabilities(&self) -> Result<cec_caps>

Source

pub async fn get_driver_name(&self) -> Result<OsString>

Source

pub async fn get_adapter_name(&self) -> Result<OsString>

Source

pub async fn get_physical_address(&self) -> Result<PhysicalAddress>

Source

pub async fn set_physical_address( &self, phys_addr: PhysicalAddress, ) -> Result<()>

Source

pub async fn get_logical_addresses(&self) -> Result<Vec<LogicalAddress>>

Source

pub async fn set_logical_addresses( &self, log_addrs: &[LogicalAddressType], ) -> Result<()>

Source

pub async fn set_logical_address( &self, log_addr: LogicalAddressType, ) -> Result<()>

Source

pub async fn clear_logical_addresses(&self) -> Result<()>

Source

pub async fn get_osd_name(&self) -> Result<OsString>

Source

pub async fn set_osd_name(&self, name: &str) -> Result<()>

Source

pub async fn get_vendor_id(&self) -> Result<Option<VendorId>>

Source

pub async fn set_vendor_id(&self, vendor_id: Option<VendorId>) -> Result<()>

Source

pub async fn tx_message( &self, message: &Message, destination: LogicalAddress, ) -> Result<u32>

Source

pub async fn tx_raw_message(&self, message: &mut cec_msg) -> Result<()>

Source

pub async fn tx_rx_message( &self, message: &Message, destination: LogicalAddress, opcode: Opcode, timeout: Timeout, ) -> Result<Envelope>

Source

pub async fn rx_message(&self, timeout: Timeout) -> Result<Envelope>

Source

pub async fn rx_raw_message(&self, timeout: u32) -> Result<cec_msg>

Source

pub async fn poll_address(&self, destination: LogicalAddress) -> Result<()>

Source

pub async fn handle_status(&self, status: PollStatus) -> Result<Vec<PollResult>>

Source

pub async fn get_connector_info(&self) -> Result<ConnectorInfo>

Source

pub async fn set_active_source( &self, address: Option<PhysicalAddress>, ) -> Result<()>

Source

pub async fn wake(&self, set_active: bool, text_view: bool) -> Result<()>

Source

pub async fn standby(&self, target: LogicalAddress) -> Result<()>

Source

pub async fn press_user_control( &self, ui_command: UiCommand, target: LogicalAddress, ) -> Result<()>

Source

pub async fn release_user_control(&self, target: LogicalAddress) -> Result<()>

Source

pub async fn close(self) -> Result<()>

Clean up the underlying Device struct. This is safer than just dropping it, as you can handle any errors that may occur.

Trait Implementations§

Source§

impl Debug for AsyncDevice

Source§

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

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

impl Drop for AsyncDevice

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<Device> for AsyncDevice

Source§

fn from(device: Device) -> AsyncDevice

Converts to this type from the input type.
Source§

impl TryFrom<File> for AsyncDevice

Source§

type Error = Error

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

fn try_from(file: File) -> Result<AsyncDevice>

Performs the conversion.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more