Struct GCSerialInterface
#[repr(transparent)]pub struct GCSerialInterface(sGCSerialInterface);Expand description
Zero-cost abstraction over Serial interface configuration from C ABI.
This struct wraps the C ABI struct and provides safe Rust accessors.
Tuple Fields§
§0: sGCSerialInterfaceImplementations§
§impl GCSerialInterface
impl GCSerialInterface
pub fn interface<'a>(&'a self) -> Cow<'a, str>
pub fn interface<'a>(&'a self) -> Cow<'a, str>
Get the OS interface path (e.g., “/dev/ttyS0”, “/dev/ttyM0”)
Returns the interface path as a string slice, or None if the C string is invalid.
pub fn parity(&self) -> Result<Parity, GCPluginABIError>
pub fn parity(&self) -> Result<Parity, GCPluginABIError>
Get the parity setting
pub fn stop_bits(&self) -> Result<StopBits, GCPluginABIError>
pub fn stop_bits(&self) -> Result<StopBits, GCPluginABIError>
Get the number of stop bits
pub fn data_bits(&self) -> Result<DataBits, GCPluginABIError>
pub fn data_bits(&self) -> Result<DataBits, GCPluginABIError>
Get the number of data bits
Trait Implementations§
§impl Debug for GCSerialInterface
impl Debug for GCSerialInterface
§impl GCAbiConversion for GCSerialInterface
impl GCAbiConversion for GCSerialInterface
type CType = sGCSerialInterface
§fn from_c_ref(c_type: &Self::CType) -> &Self
fn from_c_ref(c_type: &Self::CType) -> &Self
Get a reference to the converted type
§unsafe fn from_c_ptr(ptr: *const Self::CType) -> &'static Self
unsafe fn from_c_ptr(ptr: *const Self::CType) -> &'static Self
Get a mutable reference to the C type Read more
§unsafe fn as_mut_ptr(&mut self) -> *mut Self::CType
unsafe fn as_mut_ptr(&mut self) -> *mut Self::CType
Get a mutable reference to the C type Read more
Auto Trait Implementations§
impl Freeze for GCSerialInterface
impl RefUnwindSafe for GCSerialInterface
impl Send for GCSerialInterface
impl Sync for GCSerialInterface
impl Unpin for GCSerialInterface
impl UnsafeUnpin for GCSerialInterface
impl UnwindSafe for GCSerialInterface
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