Struct windows::Devices::SerialCommunication::SerialDevice
pub struct SerialDevice(/* private fields */);
Implementations§
§impl SerialDevice
impl SerialDevice
pub fn Close(&self) -> Result<()>
pub fn BaudRate(&self) -> Result<u32>
pub fn SetBaudRate(&self, value: u32) -> Result<()>
pub fn BreakSignalState(&self) -> Result<bool>
pub fn SetBreakSignalState(&self, value: bool) -> Result<()>
pub fn BytesReceived(&self) -> Result<u32>
pub fn CarrierDetectState(&self) -> Result<bool>
pub fn ClearToSendState(&self) -> Result<bool>
pub fn DataBits(&self) -> Result<u16>
pub fn SetDataBits(&self, value: u16) -> Result<()>
pub fn DataSetReadyState(&self) -> Result<bool>
pub fn Handshake(&self) -> Result<SerialHandshake>
pub fn SetHandshake(&self, value: SerialHandshake) -> Result<()>
pub fn IsDataTerminalReadyEnabled(&self) -> Result<bool>
pub fn SetIsDataTerminalReadyEnabled(&self, value: bool) -> Result<()>
pub fn IsRequestToSendEnabled(&self) -> Result<bool>
pub fn SetIsRequestToSendEnabled(&self, value: bool) -> Result<()>
pub fn Parity(&self) -> Result<SerialParity>
pub fn SetParity(&self, value: SerialParity) -> Result<()>
pub fn PortName(&self) -> Result<HSTRING>
pub fn ReadTimeout(&self) -> Result<TimeSpan>
pub fn SetReadTimeout(&self, value: TimeSpan) -> Result<()>
pub fn StopBits(&self) -> Result<SerialStopBitCount>
pub fn SetStopBits(&self, value: SerialStopBitCount) -> Result<()>
pub fn UsbVendorId(&self) -> Result<u16>
pub fn UsbProductId(&self) -> Result<u16>
pub fn WriteTimeout(&self) -> Result<TimeSpan>
pub fn SetWriteTimeout(&self, value: TimeSpan) -> Result<()>
pub fn InputStream(&self) -> Result<IInputStream>
pub fn OutputStream(&self) -> Result<IOutputStream>
pub fn ErrorReceived<P0>( &self, reporthandler: P0, ) -> Result<EventRegistrationToken>
pub fn RemoveErrorReceived(&self, token: EventRegistrationToken) -> Result<()>
pub fn PinChanged<P0>( &self, reporthandler: P0, ) -> Result<EventRegistrationToken>
pub fn RemovePinChanged(&self, token: EventRegistrationToken) -> Result<()>
pub fn GetDeviceSelector() -> Result<HSTRING>
pub fn GetDeviceSelectorFromPortName(portname: &HSTRING) -> Result<HSTRING>
pub fn GetDeviceSelectorFromUsbVidPid( vendorid: u16, productid: u16, ) -> Result<HSTRING>
pub fn FromIdAsync(deviceid: &HSTRING) -> Result<IAsyncOperation<SerialDevice>>
Trait Implementations§
§impl CanInto<IInspectable> for SerialDevice
impl CanInto<IInspectable> for SerialDevice
§impl CanInto<IUnknown> for SerialDevice
impl CanInto<IUnknown> for SerialDevice
§impl Clone for SerialDevice
impl Clone for SerialDevice
§fn clone(&self) -> SerialDevice
fn clone(&self) -> SerialDevice
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for SerialDevice
impl Debug for SerialDevice
§impl From<&SerialDevice> for &IInspectable
impl From<&SerialDevice> for &IInspectable
§fn from(value: &SerialDevice) -> Self
fn from(value: &SerialDevice) -> Self
Converts to this type from the input type.
§impl From<&SerialDevice> for &IUnknown
impl From<&SerialDevice> for &IUnknown
§fn from(value: &SerialDevice) -> Self
fn from(value: &SerialDevice) -> Self
Converts to this type from the input type.
§impl From<SerialDevice> for IInspectable
impl From<SerialDevice> for IInspectable
§fn from(value: SerialDevice) -> Self
fn from(value: SerialDevice) -> Self
Converts to this type from the input type.
§impl From<SerialDevice> for IUnknown
impl From<SerialDevice> for IUnknown
§fn from(value: SerialDevice) -> Self
fn from(value: SerialDevice) -> Self
Converts to this type from the input type.
§impl Interface for SerialDevice
impl Interface for SerialDevice
§const IID: GUID = <ISerialDevice as windows_core::Interface>::IID
const IID: GUID = <ISerialDevice as windows_core::Interface>::IID
The
GUID
associated with the interface.§fn as_raw(&self) -> *mut c_void
fn as_raw(&self) -> *mut c_void
Returns the raw COM interface pointer. The resulting pointer continues to be owned by the
Interface
implementation.§fn into_raw(self) -> *mut c_void
fn into_raw(self) -> *mut c_void
Returns the raw COM interface pointer and releases ownership. It the caller’s responsibility to release the COM interface pointer.
§fn cast<T>(&self) -> Result<T, Error>where
T: Interface,
fn cast<T>(&self) -> Result<T, Error>where
T: Interface,
Attempts to cast the current interface to another interface using
QueryInterface
. Read more§fn cast_to_any<T>(&self) -> Result<&(dyn Any + 'static), Error>where
T: ComObjectInner,
<T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,
fn cast_to_any<T>(&self) -> Result<&(dyn Any + 'static), Error>where
T: ComObjectInner,
<T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,
This casts the given COM interface to [
&dyn Any
]. Read more§fn is_object<T>(&self) -> boolwhere
T: ComObjectInner,
<T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,
fn is_object<T>(&self) -> boolwhere
T: ComObjectInner,
<T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,
§fn cast_object_ref<T>(&self) -> Result<&<T as ComObjectInner>::Outer, Error>where
T: ComObjectInner,
<T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,
fn cast_object_ref<T>(&self) -> Result<&<T as ComObjectInner>::Outer, Error>where
T: ComObjectInner,
<T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,
This casts the given COM interface to [
&dyn Any
]. It returns a reference to the “outer”
object, e.g. &MyApp_Impl
, not the inner &MyApp
object. Read more§fn cast_object<T>(&self) -> Result<ComObject<T>, Error>where
T: ComObjectInner,
<T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,
fn cast_object<T>(&self) -> Result<ComObject<T>, Error>where
T: ComObjectInner,
<T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,
This casts the given COM interface to [
&dyn Any
]. It returns a reference to the “outer”
object, e.g. MyApp_Impl
, not the inner MyApp
object. Read more§fn downgrade(&self) -> Result<Weak<Self>, Error>
fn downgrade(&self) -> Result<Weak<Self>, Error>
Attempts to create a [
Weak
] reference to this object.§impl PartialEq for SerialDevice
impl PartialEq for SerialDevice
§fn eq(&self, other: &SerialDevice) -> bool
fn eq(&self, other: &SerialDevice) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for SerialDevice
impl Send for SerialDevice
impl StructuralPartialEq for SerialDevice
impl Sync for SerialDevice
Auto Trait Implementations§
impl Freeze for SerialDevice
impl RefUnwindSafe for SerialDevice
impl Unpin for SerialDevice
impl UnwindSafe for SerialDevice
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)