pub struct InventorySearchFlags(/* private fields */);Expand description
Search flags used by inventory commands (for example 0x22 and 0xAA48).
For asynchronous inventory, protocol docs define extra semantics:
- bits 8..=11: rest ratio steps (0..=15)
- bit 15: heartbeat enable
- bit 14: auto-stop enable
Implementations§
Source§impl InventorySearchFlags
impl InventorySearchFlags
Sourcepub const fn async_rest_ratio_steps(self) -> u8
pub const fn async_rest_ratio_steps(self) -> u8
Extract asynchronous rest-ratio steps from bits 8..=11.
Sourcepub const fn async_heartbeat_enabled(self) -> bool
pub const fn async_heartbeat_enabled(self) -> bool
Return whether asynchronous heartbeat is enabled (bit 15).
Sourcepub const fn async_auto_stop_enabled(self) -> bool
pub const fn async_auto_stop_enabled(self) -> bool
Return whether asynchronous auto-stop is enabled (bit 14).
Sourcepub const fn embedded_command_enabled(self) -> bool
pub const fn embedded_command_enabled(self) -> bool
Return whether inventory embedded command mode is enabled (bit 2).
This bit is documented for command 0x22 and reused by
asynchronous inventory start (0xAA48).
Sourcepub fn with_async_rest_ratio_steps(
self,
steps: u8,
) -> Result<Self, ProtocolError>
pub fn with_async_rest_ratio_steps( self, steps: u8, ) -> Result<Self, ProtocolError>
Set asynchronous rest-ratio steps (0..=15) in bits 8..=11.
Sourcepub const fn with_async_heartbeat(self, enabled: bool) -> Self
pub const fn with_async_heartbeat(self, enabled: bool) -> Self
Set or clear asynchronous heartbeat enable (bit 15).
Sourcepub const fn with_async_auto_stop(self, enabled: bool) -> Self
pub const fn with_async_auto_stop(self, enabled: bool) -> Self
Set or clear asynchronous auto-stop enable (bit 14).
Sourcepub const fn with_embedded_command(self, enabled: bool) -> Self
pub const fn with_embedded_command(self, enabled: bool) -> Self
Set or clear inventory embedded command mode (bit 2).
Trait Implementations§
Source§impl Clone for InventorySearchFlags
impl Clone for InventorySearchFlags
Source§fn clone(&self) -> InventorySearchFlags
fn clone(&self) -> InventorySearchFlags
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 InventorySearchFlags
impl Debug for InventorySearchFlags
Source§impl Default for InventorySearchFlags
impl Default for InventorySearchFlags
Source§impl From<InventorySearchFlags> for u16
impl From<InventorySearchFlags> for u16
Source§fn from(value: InventorySearchFlags) -> Self
fn from(value: InventorySearchFlags) -> Self
Converts to this type from the input type.
Source§impl From<u16> for InventorySearchFlags
impl From<u16> for InventorySearchFlags
Source§impl PartialEq for InventorySearchFlags
impl PartialEq for InventorySearchFlags
Source§fn eq(&self, other: &InventorySearchFlags) -> bool
fn eq(&self, other: &InventorySearchFlags) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for InventorySearchFlags
impl Eq for InventorySearchFlags
impl StructuralPartialEq for InventorySearchFlags
Auto Trait Implementations§
impl Freeze for InventorySearchFlags
impl RefUnwindSafe for InventorySearchFlags
impl Send for InventorySearchFlags
impl Sync for InventorySearchFlags
impl Unpin for InventorySearchFlags
impl UnsafeUnpin for InventorySearchFlags
impl UnwindSafe for InventorySearchFlags
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