pub struct ResourceId(pub u32);Expand description
A resource_identifier() — 4 octets, carried verbatim as a big-endian u32.
Tuple Fields§
§0: u32Implementations§
Source§impl ResourceId
impl ResourceId
Sourcepub const fn id_type(self) -> u8
pub const fn id_type(self) -> u8
resource_id_type — the two MSBs of the first octet (0/1/2 = public,
3 = private).
Sourcepub const fn is_private(self) -> bool
pub const fn is_private(self) -> bool
True if this is a private resource (resource_id_type == 3).
Sourcepub const fn resource_class(self) -> u16
pub const fn resource_class(self) -> u16
resource_class (14 bits) for a public resource — meaningless if
is_private.
Sourcepub const fn resource_type(self) -> u16
pub const fn resource_type(self) -> u16
resource_type (10 bits) for a public resource.
Sourcepub const fn resource_version(self) -> u8
pub const fn resource_version(self) -> u8
resource_version (6 bits) for a public resource.
Trait Implementations§
Source§impl Clone for ResourceId
impl Clone for ResourceId
Source§fn clone(&self) -> ResourceId
fn clone(&self) -> ResourceId
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 moreimpl Copy for ResourceId
Source§impl Debug for ResourceId
impl Debug for ResourceId
Source§impl Display for ResourceId
impl Display for ResourceId
impl Eq for ResourceId
Source§impl Hash for ResourceId
impl Hash for ResourceId
Source§impl Ord for ResourceId
impl Ord for ResourceId
Source§fn cmp(&self, other: &ResourceId) -> Ordering
fn cmp(&self, other: &ResourceId) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'a> Parse<'a> for ResourceId
impl<'a> Parse<'a> for ResourceId
Source§impl PartialEq for ResourceId
impl PartialEq for ResourceId
Source§impl PartialOrd for ResourceId
impl PartialOrd for ResourceId
Source§impl Serialize for ResourceId
Available on crate feature serde only.
impl Serialize for ResourceId
Available on crate feature
serde only.Source§impl Serialize for ResourceId
impl Serialize for ResourceId
Source§type Error = Error
type Error = Error
The error type this implementer returns (usually the same as the
corresponding
Parse impl, but need not be).Source§fn serialized_len(&self) -> usize
fn serialized_len(&self) -> usize
Number of bytes
serialize_into will write.impl StructuralPartialEq for ResourceId
Auto Trait Implementations§
impl Freeze for ResourceId
impl RefUnwindSafe for ResourceId
impl Send for ResourceId
impl Sync for ResourceId
impl Unpin for ResourceId
impl UnsafeUnpin 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