pub enum FlowControl {
None,
Software,
Hardware,
}
Expand description
Flow control modes for serial communication
Flow control prevents data loss by allowing the receiver to signal when it’s ready to receive more data.
§Example
use tauri_plugin_serialplugin::state::FlowControl;
let flow_control = FlowControl::None; // No flow control
Variants§
None
No flow control (most common for simple applications)
Software
Software flow control using XON/XOFF bytes
Hardware
Hardware flow control using RTS/CTS signals
Implementations§
Source§impl FlowControl
impl FlowControl
Sourcepub fn as_u8(&self) -> u8
pub fn as_u8(&self) -> u8
Converts the flow control enum to its numeric value
Returns the flow control mode as a u8
value.
§Returns
The flow control mode: 0 (None), 1 (Software), or 2 (Hardware).
§Example
use tauri_plugin_serialplugin::state::FlowControl;
let flow_control = FlowControl::None;
assert_eq!(flow_control.as_u8(), 0);
Trait Implementations§
Source§impl Clone for FlowControl
impl Clone for FlowControl
Source§fn clone(&self) -> FlowControl
fn clone(&self) -> FlowControl
Returns a duplicate 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 moreSource§impl Debug for FlowControl
impl Debug for FlowControl
Source§impl<'de> Deserialize<'de> for FlowControl
impl<'de> Deserialize<'de> for FlowControl
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
Source§impl From<FlowControl> for FlowControl
impl From<FlowControl> for FlowControl
Source§fn from(flow: FlowControl) -> Self
fn from(flow: FlowControl) -> Self
Converts to this type from the input type.
Source§impl PartialEq for FlowControl
impl PartialEq for FlowControl
Source§impl Serialize for FlowControl
impl Serialize for FlowControl
impl Copy for FlowControl
impl Eq for FlowControl
impl StructuralPartialEq for FlowControl
Auto Trait Implementations§
impl Freeze for FlowControl
impl RefUnwindSafe for FlowControl
impl Send for FlowControl
impl Sync for FlowControl
impl Unpin for FlowControl
impl UnwindSafe for FlowControl
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§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
Source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.