Struct golden_apple::UUID
source · [−]pub struct UUID { /* private fields */ }
Expand description
Represents a Unique User ID. Used to track players and entities.
Implementations
sourceimpl UUID
impl UUID
sourcepub fn from_reader<R: Read>(reader: &mut R) -> Result<UUID, Error>
pub fn from_reader<R: Read>(reader: &mut R) -> Result<UUID, Error>
Generates a UUID from a Read type.
sourcepub fn from_bytes(data: &[u8]) -> Result<(UUID, usize), Error>
pub fn from_bytes(data: &[u8]) -> Result<(UUID, usize), Error>
Generates a UUID from a byte array. Returns the UUID and amount of bytes needed.
sourcepub fn from_username(username: String) -> Result<UUID, Error>
pub fn from_username(username: String) -> Result<UUID, Error>
Generates a UUID from a username. This function uses Mojang’s API, and may be subject to rate limiting. Cache your results.
sourcepub fn to_writer<W: Write>(self, writer: &mut W) -> Result<(), Error>
pub fn to_writer<W: Write>(self, writer: &mut W) -> Result<(), Error>
Writes this UUID to a Write type.
sourcepub fn to_bytes(self) -> Result<Vec<u8>, Error>
pub fn to_bytes(self) -> Result<Vec<u8>, Error>
Creates a byte array with the data of this UUID in it.
sourcepub fn to_username(self) -> Result<String, Error>
pub fn to_username(self) -> Result<String, Error>
Gives the username associated with this UUID. This function uses Mojang’s API, and may be subject to rate limiting. Cache your results.
Trait Implementations
sourceimpl PartialEq<UUID> for UUID
impl PartialEq<UUID> for UUID
impl Eq for UUID
impl StructuralEq for UUID
impl StructuralPartialEq for UUID
Auto Trait Implementations
impl RefUnwindSafe for UUID
impl Send for UUID
impl Sync for UUID
impl Unpin for UUID
impl UnwindSafe for UUID
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
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more