Struct message_io::network::ResourceId
source · pub struct ResourceId { /* private fields */ }
Expand description
Unique identifier of a network resource in your system. The identifier wrap 3 values,
- The type, that can be a value of ResourceType.
- The adapter id, that represents the adapter that creates this id
- The base value: that is an unique identifier of the resource inside of its adapter.
Implementations§
source§impl ResourceId
impl ResourceId
pub const MAX_BASE_VALUE: usize = 16_777_215usize
pub const MAX_ADAPTER_ID: u8 = 127u8
pub const MAX_ADAPTERS: usize = 128usize
sourcepub fn resource_type(&self) -> ResourceType
pub fn resource_type(&self) -> ResourceType
Returns the ResourceType of this resource
sourcepub fn adapter_id(&self) -> u8
pub fn adapter_id(&self) -> u8
Returns the associated adapter id.
Note that this returned value is the same as the value of crate::network::Transport::id()
if that transport uses the same adapter.
sourcepub fn base_value(&self) -> usize
pub fn base_value(&self) -> usize
Returns the unique resource identifier inside the associated adapter.
Trait Implementations§
source§impl Clone for ResourceId
impl Clone for ResourceId
source§fn clone(&self) -> ResourceId
fn clone(&self) -> ResourceId
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 moresource§impl Debug for ResourceId
impl Debug for ResourceId
source§impl Display for ResourceId
impl Display for ResourceId
source§impl From<ResourceId> for Token
impl From<ResourceId> for Token
source§fn from(id: ResourceId) -> Self
fn from(id: ResourceId) -> Self
Converts to this type from the input type.
source§impl From<Token> for ResourceId
impl From<Token> for ResourceId
source§impl From<usize> for ResourceId
impl From<usize> for ResourceId
source§impl Hash for ResourceId
impl Hash for ResourceId
source§impl PartialEq for ResourceId
impl PartialEq for ResourceId
source§fn eq(&self, other: &ResourceId) -> bool
fn eq(&self, other: &ResourceId) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for ResourceId
impl Eq for ResourceId
impl StructuralPartialEq for ResourceId
Auto Trait Implementations§
impl RefUnwindSafe for ResourceId
impl Send for ResourceId
impl Sync for ResourceId
impl Unpin for ResourceId
impl UnwindSafe for ResourceId
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