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
sourceimpl ResourceId
impl ResourceId
pub const MAX_BASE_VALUE: usize = 72_057_594_037_927_935usize
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
sourceimpl Clone for ResourceId
impl Clone for ResourceId
sourcefn clone(&self) -> ResourceId
fn clone(&self) -> ResourceId
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ResourceId
impl Debug for ResourceId
sourceimpl Display for ResourceId
impl Display for ResourceId
sourceimpl From<ResourceId> for Token
impl From<ResourceId> for Token
sourcefn from(id: ResourceId) -> Self
fn from(id: ResourceId) -> Self
Converts to this type from the input type.
sourceimpl From<Token> for ResourceId
impl From<Token> for ResourceId
sourceimpl From<usize> for ResourceId
impl From<usize> for ResourceId
sourceimpl Hash for ResourceId
impl Hash for ResourceId
sourceimpl PartialEq<ResourceId> for ResourceId
impl PartialEq<ResourceId> for ResourceId
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &ResourceId) -> bool
fn ne(&self, other: &ResourceId) -> bool
This method tests for !=
.
impl Copy for ResourceId
impl Eq for ResourceId
impl StructuralEq 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more