Type Alias bevy::asset::meta::AssetHash

pub type AssetHash = [u8; 32];

Trait Implementations§

§

impl<T, const N: usize> Array for [T; N]where T: Reflect + TypePath,

§

fn get(&self, index: usize) -> Option<&(dyn Reflect + 'static)>

Returns a reference to the element at index, or None if out of bounds.
§

fn get_mut(&mut self, index: usize) -> Option<&mut (dyn Reflect + 'static)>

Returns a mutable reference to the element at index, or None if out of bounds.
§

fn len(&self) -> usize

Returns the number of elements in the array.
§

fn iter(&self) -> ArrayIter<'_>

Returns an iterator over the array.
§

fn drain(self: Box<[T; N], Global>) -> Vec<Box<dyn Reflect, Global>, Global>

Drain the elements of this array to get a vector of owned values.
§

fn is_empty(&self) -> bool

Returns true if the collection contains no elements.
§

fn clone_dynamic(&self) -> DynamicArray

Clones the list, producing a DynamicArray.
§

impl<const LEN: usize> BufferMut for [u8; LEN]

§

fn capacity(&self) -> usize

§

fn write<const N: usize>(&mut self, offset: usize, val: &[u8; N])

§

fn try_enlarge(&mut self, wanted: usize) -> Result<(), EnlargeError>

§

impl<const LEN: usize> BufferRef for [u8; LEN]

§

fn len(&self) -> usize

§

fn read<const N: usize>(&self, offset: usize) -> &[u8; N]

1.58.0 · source§

impl<T, const N: usize> Clone for [T; N]where T: Clone,

source§

fn clone(&self) -> [T; N]

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, other: &[T; N])

Performs copy-assignment from source. Read more
§

impl<T, const N: usize> CreateFrom for [T; N]where T: CreateFrom, [T; N]: ShaderType<ExtraMetadata = ArrayMetadata>,

§

fn create_from<B>(reader: &mut Reader<B>) -> [T; N]where B: BufferRef,

1.0.0 · source§

impl<T, const N: usize> Debug for [T; N]where T: Debug,

source§

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

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

impl<T> Default for [T; 0]

source§

fn default() -> [T; 0]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 1]where T: Default,

source§

fn default() -> [T; 1]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 10]where T: Default,

source§

fn default() -> [T; 10]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 11]where T: Default,

source§

fn default() -> [T; 11]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 12]where T: Default,

source§

fn default() -> [T; 12]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 13]where T: Default,

source§

fn default() -> [T; 13]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 14]where T: Default,

source§

fn default() -> [T; 14]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 15]where T: Default,

source§

fn default() -> [T; 15]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 16]where T: Default,

source§

fn default() -> [T; 16]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 17]where T: Default,

source§

fn default() -> [T; 17]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 18]where T: Default,

source§

fn default() -> [T; 18]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 19]where T: Default,

source§

fn default() -> [T; 19]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 2]where T: Default,

source§

fn default() -> [T; 2]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 20]where T: Default,

source§

fn default() -> [T; 20]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 21]where T: Default,

source§

fn default() -> [T; 21]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 22]where T: Default,

source§

fn default() -> [T; 22]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 23]where T: Default,

source§

fn default() -> [T; 23]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 24]where T: Default,

source§

fn default() -> [T; 24]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 25]where T: Default,

source§

fn default() -> [T; 25]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 26]where T: Default,

source§

fn default() -> [T; 26]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 27]where T: Default,

source§

fn default() -> [T; 27]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 28]where T: Default,

source§

fn default() -> [T; 28]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 29]where T: Default,

source§

fn default() -> [T; 29]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 3]where T: Default,

source§

fn default() -> [T; 3]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 30]where T: Default,

source§

fn default() -> [T; 30]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 31]where T: Default,

source§

fn default() -> [T; 31]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 32]where T: Default,

source§

fn default() -> [T; 32]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 4]where T: Default,

source§

fn default() -> [T; 4]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 5]where T: Default,

source§

fn default() -> [T; 5]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 6]where T: Default,

source§

fn default() -> [T; 6]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 7]where T: Default,

source§

fn default() -> [T; 7]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 8]where T: Default,

source§

fn default() -> [T; 8]

Returns the “default value” for a type. Read more
1.4.0 · source§

impl<T> Default for [T; 9]where T: Default,

source§

fn default() -> [T; 9]

Returns the “default value” for a type. Read more
source§

impl<'de, T> Deserialize<'de> for [T; 32]where T: Deserialize<'de>,

source§

fn deserialize<D>( deserializer: D ) -> Result<[T; 32], <D as Deserializer<'de>>::Error>where D: Deserializer<'de>,

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

impl<T> From<GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>> for [T; 32]

§

fn from( sel: GenericArray<T, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>> ) -> [T; 32]

Converts to this type from the input type.
§

impl From<Hash> for [u8; 32]

§

fn from(hash: Hash) -> [u8; 32]

Converts to this type from the input type.
source§

impl<T, const N: usize> From<Simd<T, N>> for [T; N]where LaneCount<N>: SupportedLaneCount, T: SimdElement,

source§

fn from(vector: Simd<T, N>) -> [T; N]

Converts to this type from the input type.
§

impl<T, const N: usize> FromReflect for [T; N]where T: FromReflect + TypePath,

§

fn from_reflect(reflect: &(dyn Reflect + 'static)) -> Option<[T; N]>

Constructs a concrete instance of Self from a reflected value.
§

fn take_from_reflect( reflect: Box<dyn Reflect, Global> ) -> Result<Self, Box<dyn Reflect, Global>>

Attempts to downcast the given value to Self using, constructing the value using from_reflect if that fails. Read more
§

impl<T> GetTypeRegistration for [T; 32]where T: Reflect + TypePath,

§

impl<T, const N: usize> ReadFrom for [T; N]where T: ReadFrom, [T; N]: ShaderType<ExtraMetadata = ArrayMetadata>,

§

fn read_from<B>(&mut self, reader: &mut Reader<B>)where B: BufferRef,

§

impl<T, const N: usize> Reflect for [T; N]where T: Reflect + TypePath,

§

fn get_represented_type_info(&self) -> Option<&'static TypeInfo>

Returns the TypeInfo of the type represented by this value. Read more
§

fn into_any(self: Box<[T; N], Global>) -> Box<dyn Any, Global>

Returns the value as a Box<dyn Any>.
§

fn as_any(&self) -> &(dyn Any + 'static)

Returns the value as a &dyn Any.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Returns the value as a &mut dyn Any.
§

fn into_reflect(self: Box<[T; N], Global>) -> Box<dyn Reflect, Global>

Casts this type to a boxed reflected value.
§

fn as_reflect(&self) -> &(dyn Reflect + 'static)

Casts this type to a reflected value.
§

fn as_reflect_mut(&mut self) -> &mut (dyn Reflect + 'static)

Casts this type to a mutable reflected value.
§

fn apply(&mut self, value: &(dyn Reflect + 'static))

Applies a reflected value to this value. Read more
§

fn set( &mut self, value: Box<dyn Reflect, Global> ) -> Result<(), Box<dyn Reflect, Global>>

Performs a type-checked assignment of a reflected value to this value. Read more
§

fn reflect_ref(&self) -> ReflectRef<'_>

Returns an enumeration of “kinds” of type. Read more
§

fn reflect_mut(&mut self) -> ReflectMut<'_>

Returns a mutable enumeration of “kinds” of type. Read more
§

fn reflect_owned(self: Box<[T; N], Global>) -> ReflectOwned

Returns an owned enumeration of “kinds” of type. Read more
§

fn clone_value(&self) -> Box<dyn Reflect, Global>

Clones the value as a Reflect trait object. Read more
§

fn reflect_hash(&self) -> Option<u64>

Returns a hash of the value (which includes the type). Read more
§

fn reflect_partial_eq(&self, value: &(dyn Reflect + 'static)) -> Option<bool>

Returns a “partial equality” comparison result. Read more
§

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

Debug formatter for the value. Read more
§

fn serializable(&self) -> Option<Serializable<'_>>

Returns a serializable version of the value. Read more
§

fn is_dynamic(&self) -> bool

Indicates whether or not this type is a dynamic type. Read more
source§

impl<T> Serialize for [T; 32]where T: Serialize,

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
§

impl<T, const N: usize> ShaderSize for [T; N]where T: ShaderSize,

§

const SHADER_SIZE: NonZeroU64 = _

Represents WGSL Size (equivalent to ShaderType::min_size)
§

impl<T, const N: usize> ShaderType for [T; N]where T: ShaderType + ShaderSize,

§

fn min_size() -> NonZeroU64

Represents the minimum size of Self (equivalent to GPUBufferBindingLayout.minBindingSize) Read more
§

fn size(&self) -> NonZeroU64

Returns the size of Self at runtime Read more
§

fn assert_uniform_compat()

1.34.0 · source§

impl<T, const N: usize> TryFrom<&[T]> for [T; N]where T: Copy,

Tries to create an array [T; N] by copying from a slice &[T]. Succeeds if slice.len() == N.

let bytes: [u8; 3] = [1, 0, 2];

let bytes_head: [u8; 2] = <[u8; 2]>::try_from(&bytes[0..2]).unwrap();
assert_eq!(1, u16::from_le_bytes(bytes_head));

let bytes_tail: [u8; 2] = bytes[1..3].try_into().unwrap();
assert_eq!(512, u16::from_le_bytes(bytes_tail));
§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(slice: &[T]) -> Result<[T; N], TryFromSliceError>

Performs the conversion.
1.59.0 · source§

impl<T, const N: usize> TryFrom<&mut [T]> for [T; N]where T: Copy,

Tries to create an array [T; N] by copying from a mutable slice &mut [T]. Succeeds if slice.len() == N.

let mut bytes: [u8; 3] = [1, 0, 2];

let bytes_head: [u8; 2] = <[u8; 2]>::try_from(&mut bytes[0..2]).unwrap();
assert_eq!(1, u16::from_le_bytes(bytes_head));

let bytes_tail: [u8; 2] = (&mut bytes[1..3]).try_into().unwrap();
assert_eq!(512, u16::from_le_bytes(bytes_tail));
§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
source§

fn try_from(slice: &mut [T]) -> Result<[T; N], TryFromSliceError>

Performs the conversion.
1.48.0 · source§

impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where A: Allocator,

source§

fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>

Gets the entire contents of the Vec<T> as an array, if its size exactly matches that of the requested array.

Examples
assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));
assert_eq!(<Vec<i32>>::new().try_into(), Ok([]));

If the length doesn’t match, the input comes back in Err:

let r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();
assert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));

If you’re fine with just getting a prefix of the Vec<T>, you can call .truncate(N) first.

let mut v = String::from("hello world").into_bytes();
v.sort();
v.truncate(2);
let [a, b]: [_; 2] = v.try_into().unwrap();
assert_eq!(a, b' ');
assert_eq!(b, b'd');
§

type Error = Vec<T, A>

The type returned in the event of a conversion error.
§

impl<T, A, const N: usize> TryFrom<Vec<T, A>> for [T; N]where A: Allocator,

§

fn try_from(vec: Vec<T, A>) -> Result<[T; N], Vec<T, A>>

Gets the entire contents of the Vec<T> as an array, if its size exactly matches that of the requested array.

Examples
assert_eq!(vec![1, 2, 3].try_into(), Ok([1, 2, 3]));
assert_eq!(<Vec<i32>>::new().try_into(), Ok([]));

If the length doesn’t match, the input comes back in Err:

let r: Result<[i32; 4], _> = (0..10).collect::<Vec<_>>().try_into();
assert_eq!(r, Err(vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9]));

If you’re fine with just getting a prefix of the Vec<T>, you can call .truncate(N) first.

let mut v = String::from("hello world").into_bytes();
v.sort();
v.truncate(2);
let [a, b]: [_; 2] = v.try_into().unwrap();
assert_eq!(a, b' ');
assert_eq!(b, b'd');
§

type Error = Vec<T, A>

The type returned in the event of a conversion error.
§

impl<T, const N: usize> TypePath for [T; N]where T: TypePath,

§

fn type_path() -> &'static str

Returns the fully qualified path of the underlying type. Read more
§

fn short_type_path() -> &'static str

Returns a short, pretty-print enabled path to the type. Read more
§

fn type_ident() -> Option<&'static str>

Returns the name of the type, or None if it is anonymous. Read more
§

fn crate_name() -> Option<&'static str>

Returns the name of the crate the type is in, or None if it is anonymous. Read more
§

fn module_path() -> Option<&'static str>

Returns the path to the module the type is in, or None if it is anonymous. Read more
§

impl<T, const N: usize> TypeUuid for [T; N]where T: TypeUuid,

§

const TYPE_UUID: Uuid = _

§

impl<T, const N: usize> Typed for [T; N]where T: Reflect + TypePath,

§

fn type_info() -> &'static TypeInfo

Returns the compile-time info for the underlying type.
§

impl<T, const N: usize> WriteInto for [T; N]where T: WriteInto, [T; N]: ShaderType<ExtraMetadata = ArrayMetadata>,

§

fn write_into<B>(&self, writer: &mut Writer<B>)where B: BufferMut,

§

impl<T> Zeroable for [T; 32]where T: Zeroable,

§

fn zeroed() -> Self

§

impl<T> Pod for [T; 32]where T: Pod,