Type Alias bones_framework::asset::prelude::AssetPackId

source ·
pub type AssetPackId = LabeledId;
Expand description

The unique ID for an asset pack.

Asset pack IDs are made up of a human-readable label, and a unique identifier. For example:

awesome-pack_01h502c309fddv1vq1gwa918e8

These IDs can be generated with the TypeID gen utility.

Aliased Type§

struct AssetPackId { /* private fields */ }

Implementations

source§

impl LabeledId

source

pub fn new(prefix: &str) -> Result<LabeledId, LabeledIdCreateError>

Create a new labeled ID with the given prefix.

source

pub fn new_with_ulid( prefix: &str, ulid: Ulid, ) -> Result<LabeledId, LabeledIdCreateError>

Create a new labeled ID with the given prefix and ULID.

source

pub fn prefix(&self) -> &str

Get the prefix of the ID.

source

pub fn ulid(&self) -> Ulid

Get the Ulid of the ID.

Trait Implementations

source§

impl Clone for LabeledId

source§

fn clone(&self) -> LabeledId

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for LabeledId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for LabeledId

source§

fn deserialize<D>( deserializer: D, ) -> Result<LabeledId, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for LabeledId

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl FromStr for LabeledId

§

type Err = LabledIdParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<LabeledId, <LabeledId as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for LabeledId

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for LabeledId

source§

fn cmp(&self, other: &LabeledId) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for LabeledId

source§

fn eq(&self, other: &LabeledId) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for LabeledId

source§

fn partial_cmp(&self, other: &LabeledId) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Serialize for LabeledId

source§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for LabeledId

source§

impl Eq for LabeledId

source§

impl StructuralPartialEq for LabeledId