Struct bevy_core::prelude::Name[][src]

pub struct Name { /* fields omitted */ }

Component used to identify an entity. Stores a hash for faster comparisons

Implementations

impl Name[src]

pub fn new(name: impl Into<Cow<'static, str>>) -> Self[src]

pub fn set(&mut self, name: impl Into<Cow<'static, str>>)[src]

pub fn mutate<F: FnOnce(&mut String)>(&mut self, f: F)[src]

pub fn as_str(&self) -> &str[src]

Methods from Deref<Target = Cow<'static, str>>

pub const fn is_borrowed(&self) -> bool[src]

🔬 This is a nightly-only experimental API. (cow_is_borrowed)

Returns true if the data is borrowed, i.e. if to_mut would require additional work.

Examples

#![feature(cow_is_borrowed)]
use std::borrow::Cow;

let cow = Cow::Borrowed("moo");
assert!(cow.is_borrowed());

let bull: Cow<'_, str> = Cow::Owned("...moo?".to_string());
assert!(!bull.is_borrowed());

pub const fn is_owned(&self) -> bool[src]

🔬 This is a nightly-only experimental API. (cow_is_borrowed)

Returns true if the data is owned, i.e. if to_mut would be a no-op.

Examples

#![feature(cow_is_borrowed)]
use std::borrow::Cow;

let cow: Cow<'_, str> = Cow::Owned("moo".to_string());
assert!(cow.is_owned());

let bull = Cow::Borrowed("...moo?");
assert!(!bull.is_owned());

Trait Implementations

impl Clone for Name[src]

impl Debug for Name[src]

impl Default for Name[src]

impl Deref for Name[src]

type Target = Cow<'static, str>

The resulting type after dereferencing.

impl Eq for Name[src]

impl From<&'_ str> for Name[src]

impl GetTypeRegistration for Name[src]

impl Hash for Name[src]

impl Ord for Name[src]

impl PartialEq<Name> for Name[src]

impl PartialOrd<Name> for Name[src]

impl Reflect for Name[src]

impl Struct for Name[src]

Auto Trait Implementations

impl RefUnwindSafe for Name

impl Send for Name

impl Sync for Name

impl Unpin for Name

impl UnwindSafe for Name

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CallHasher for T where
    T: Hash + ?Sized

impl<T> Component for T where
    T: 'static + Send + Sync
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> DynEq for T where
    T: Any + Eq
[src]

impl<T> DynHash for T where
    T: DynEq + Hash
[src]

impl<T> From<T> for T[src]

impl<T> FromWorld for T where
    T: Default
[src]

impl<S> GetField for S where
    S: Struct
[src]

impl<T> GetPath for T where
    T: Reflect
[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> TypeData for T where
    T: 'static + Send + Sync + Clone
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,