Skip to main content

Material

Struct Material 

Source
pub struct Material { /* private fields */ }
Expand description

Complete material definition with textures, transforms, and shader parameters.

Materials contain all rendering data except geometry. The exact fields present depend on the material type - some types use only a subset of these fields.

§Field Organization

  • Identification: vertex_format, name
  • Unknown fields: uk_1 through uk_6 (only in certain material types)
  • Textures: texture_directory, textures list
  • Transforms: v_pivot, matrix1/2/3, matrix indices
  • Attachments: attachment_points for effects/weapons
  • Shader params: params_string, params_f32, params_i32, params_vector4df32
  • Cloth physics: uk_7, uk_8, uk_9 (cloth materials only)

§Matrix Storage

3x4 matrices are stored in the same format as skeleton bind pose matrices. The implicit fourth row [0, 0, 0, 1] must be added when converting to 4x4.

Implementations§

Source§

impl Material

Source

pub fn read_alpha_blend<R: ReadBytes>( data: &mut R, version: u32, ) -> Result<Self>

Source

pub fn write_alpha_blend<W: WriteBytes>( &self, data: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Source

pub fn read_cloth<R: ReadBytes>(data: &mut R, version: u32) -> Result<Self>

Source

pub fn write_cloth<W: WriteBytes>( &self, buffer: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Collision shape materials: the default material, followed by the sphere around the shape.

Source

pub fn read_collision_shape<R: ReadBytes>( data: &mut R, version: u32, ) -> Result<Self>

Source

pub fn write_collision_shape<W: WriteBytes>( &self, data: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Custom terrain materials (cliffs and other hand-made terrain pieces): just the path of their texture.

Source

pub fn read_custom_terrain<R: ReadBytes>( data: &mut R, _version: u32, ) -> Result<Self>

Source

pub fn write_custom_terrain<W: WriteBytes>( &self, data: &mut W, _version: u32, ) -> Result<()>

Source§

impl Material

Source

pub fn read_default<R: ReadBytes>(data: &mut R, version: u32) -> Result<Self>

Source

pub fn write_default<W: WriteBytes>( &self, buffer: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Source

pub fn read_rs_terrain<R: ReadBytes>(data: &mut R, version: u32) -> Result<Self>

Source

pub fn write_rs_terrain<W: WriteBytes>( &self, data: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Rope materials of version 6 RigidModels: the default material, followed by the rope as a chain of nodes.

There’s one link fewer than nodes, and the file doesn’t store their count.

Source

pub fn read_rope<R: ReadBytes>(data: &mut R, version: u32) -> Result<Self>

Source

pub fn write_rope<W: WriteBytes>( &self, buffer: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Source

pub fn read_rs_river<R: ReadBytes>(_data: &mut R, _version: u32) -> Result<Self>

Source

pub fn write_rs_river<W: WriteBytes>( &self, _data: &mut W, _version: u32, ) -> Result<()>

Source§

impl Material

Static point light materials: the name of the light, and its position in v_pivot.

Source

pub fn read_static_point_light<R: ReadBytes>( data: &mut R, version: u32, ) -> Result<Self>

Source

pub fn write_static_point_light<W: WriteBytes>( &self, data: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Texture combo materials: a name and a texture directory.

Source

pub fn read_texture_combo<R: ReadBytes>( data: &mut R, version: u32, ) -> Result<Self>

Source

pub fn write_texture_combo<W: WriteBytes>( &self, data: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Materials of type 27: the strings of the default material.

Source

pub fn read_uk_27<R: ReadBytes>(data: &mut R, version: u32) -> Result<Self>

Source

pub fn write_uk_27<W: WriteBytes>( &self, data: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Materials of types 54, 56 and 57: the strings of the default material, its pivot and its matrix index, with no vertex format. Types 56 and 57 have a second name, after the first one.

Source

pub fn read_uk_54<R: ReadBytes>( data: &mut R, version: u32, mtype: MaterialType, ) -> Result<Self>

Source

pub fn write_uk_54<W: WriteBytes>( &self, data: &mut W, version: u32, mtype: MaterialType, ) -> Result<()>

Source§

impl Material

Weighted cloth materials of version 6 RigidModels: the default material, followed by the bones of the cloth simulation.

Source

pub fn read_weighted_cloth<R: ReadBytes>( data: &mut R, version: u32, ) -> Result<Self>

Source

pub fn write_weighted_cloth<W: WriteBytes>( &self, buffer: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Projected decal materials of version 6 RigidModels: the decal’s texture path, a flag, and since ProjectedDecalV2, the box the decal is projected in.

Source

pub fn read_projected_decal<R: ReadBytes>( data: &mut R, version: u32, mtype: MaterialType, ) -> Result<Self>

Source

pub fn write_projected_decal<W: WriteBytes>( &self, data: &mut W, version: u32, mtype: MaterialType, ) -> Result<()>

Source§

impl Material

Source

pub fn read_projected_decal_v4<R: ReadBytes>( data: &mut R, version: u32, ) -> Result<Self>

Source

pub fn write_projected_decal_v4<W: WriteBytes>( &self, data: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Source

pub fn read_weighted_texture_blend<R: ReadBytes>( data: &mut R, version: u32, ) -> Result<Self>

Source

pub fn write_weighted_texture_blend<W: WriteBytes>( &self, data: &mut W, version: u32, ) -> Result<()>

Source§

impl Material

Source

pub fn vertex_format(&self) -> &VertexFormat

Vertex format determining vertex data layout.

Source

pub fn name(&self) -> &String

Material name (human-readable identifier).

Source

pub fn name2(&self) -> &String

Second name, only in materials of types 56 and 57: the name of the mesh followed by a suffix, like burning or rain.

Source

pub fn name_padding(&self) -> &Vec<u8> ⓘ

Bytes found after the end of name in its padded field, usually leftovers of the program that wrote the file. They’re kept so the file is written back as it was.

Source

pub fn uk_1(&self) -> &u32

Unknown field 1 (only in RsTerrain and projected decal materials).

Source

pub fn uk_2(&self) -> &u32

Unknown field 2 (only in RsTerrain and projected decal materials).

Source

pub fn uk_3(&self) -> &u32

Unknown field 3 (only in RsTerrain and projected decal materials).

Source

pub fn uk_4(&self) -> &u32

Unknown field 4 (only in RsTerrain and projected decal materials).

Source

pub fn uk_5(&self) -> &u32

Unknown field 5 (only in RsTerrain and projected decal materials).

Source

pub fn uk_6(&self) -> &u32

Unknown field 6 (only in RsTerrain and projected decal materials).

Source

pub fn texture_directory(&self) -> &String

Directory path for texture files (relative to game data directory).

Source

pub fn filters(&self) -> &String

Filter settings (NOT part of file format, runtime-only).

Source

pub fn padding_byte0(&self) -> &u8

Padding byte 0 (alignment/reserved).

Source

pub fn padding_byte1(&self) -> &u8

Padding byte 1 (alignment/reserved).

Source

pub fn v_pivot(&self) -> &Vector3<f32>

Pivot point for transformations.

Source

pub fn decal_center(&self) -> &Vector3<f32>

Center of the box a projected decal is projected in.

Source

pub fn decal_size(&self) -> &Vector3<f32>

Size of the box a projected decal is projected in.

Source

pub fn sphere_center(&self) -> &Vector3<f32>

Center of the sphere around a collision shape.

Source

pub fn sphere_radius(&self) -> &f32

Radius of the sphere around a collision shape.

Source

pub fn cloth_bones(&self) -> &Vec<ClothBone>

Bones of the cloth simulation of weighted cloth materials.

Source

pub fn rope(&self) -> &Rope

Simulation data of rope materials.

Source

pub fn matrix1(&self) -> &Matrix3x4<f32>

Transform matrix 1 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn matrix2(&self) -> &Matrix3x4<f32>

Transform matrix 2 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn matrix3(&self) -> &Matrix3x4<f32>

Transform matrix 3 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn i_matrix_index(&self) -> &i32

Matrix index in hierarchy.

Source

pub fn i_parent_matrix_index(&self) -> &i32

Parent matrix index for hierarchical transforms.

Source

pub fn sz_padding(&self) -> &Vec<u8> ⓘ

Additional padding bytes (variable length).

Source

pub fn attachment_points(&self) -> &Vec<AttachmentPointEntry>

Named attachment points for weapons, effects, banners, etc.

Source

pub fn textures(&self) -> &Vec<Texture>

Texture list with type and path for each texture.

Source

pub fn params_string(&self) -> &Vec<(i32, String)>

String shader parameters (index, value pairs).

Source

pub fn params_f32(&self) -> &Vec<(i32, f32)>

Float shader parameters (index, value pairs).

Source

pub fn params_i32(&self) -> &Vec<(i32, i32)>

Integer shader parameters (index, value pairs).

Source

pub fn params_vector4df32(&self) -> &Vec<(i32, Vector4<f32>)>

Vector4 shader parameters (index, value pairs).

Source

pub fn uk_7(&self) -> &Vec<Uk7>

Cloth physics data section 1 (cloth materials only, format undocumented).

Source

pub fn uk_8(&self) -> &Vec<Uk8>

Cloth physics data section 2 (cloth materials only, format undocumented).

Source

pub fn uk_9(&self) -> &Vec<Uk9>

Cloth physics data section 3 (cloth materials only, format undocumented).

Source§

impl Material

Source

pub fn vertex_format_mut(&mut self) -> &mut VertexFormat

Vertex format determining vertex data layout.

Source

pub fn name_mut(&mut self) -> &mut String

Material name (human-readable identifier).

Source

pub fn name2_mut(&mut self) -> &mut String

Second name, only in materials of types 56 and 57: the name of the mesh followed by a suffix, like burning or rain.

Source

pub fn name_padding_mut(&mut self) -> &mut Vec<u8> ⓘ

Bytes found after the end of name in its padded field, usually leftovers of the program that wrote the file. They’re kept so the file is written back as it was.

Source

pub fn uk_1_mut(&mut self) -> &mut u32

Unknown field 1 (only in RsTerrain and projected decal materials).

Source

pub fn uk_2_mut(&mut self) -> &mut u32

Unknown field 2 (only in RsTerrain and projected decal materials).

Source

pub fn uk_3_mut(&mut self) -> &mut u32

Unknown field 3 (only in RsTerrain and projected decal materials).

Source

pub fn uk_4_mut(&mut self) -> &mut u32

Unknown field 4 (only in RsTerrain and projected decal materials).

Source

pub fn uk_5_mut(&mut self) -> &mut u32

Unknown field 5 (only in RsTerrain and projected decal materials).

Source

pub fn uk_6_mut(&mut self) -> &mut u32

Unknown field 6 (only in RsTerrain and projected decal materials).

Source

pub fn texture_directory_mut(&mut self) -> &mut String

Directory path for texture files (relative to game data directory).

Source

pub fn filters_mut(&mut self) -> &mut String

Filter settings (NOT part of file format, runtime-only).

Source

pub fn padding_byte0_mut(&mut self) -> &mut u8

Padding byte 0 (alignment/reserved).

Source

pub fn padding_byte1_mut(&mut self) -> &mut u8

Padding byte 1 (alignment/reserved).

Source

pub fn v_pivot_mut(&mut self) -> &mut Vector3<f32>

Pivot point for transformations.

Source

pub fn decal_center_mut(&mut self) -> &mut Vector3<f32>

Center of the box a projected decal is projected in.

Source

pub fn decal_size_mut(&mut self) -> &mut Vector3<f32>

Size of the box a projected decal is projected in.

Source

pub fn sphere_center_mut(&mut self) -> &mut Vector3<f32>

Center of the sphere around a collision shape.

Source

pub fn sphere_radius_mut(&mut self) -> &mut f32

Radius of the sphere around a collision shape.

Source

pub fn cloth_bones_mut(&mut self) -> &mut Vec<ClothBone>

Bones of the cloth simulation of weighted cloth materials.

Source

pub fn rope_mut(&mut self) -> &mut Rope

Simulation data of rope materials.

Source

pub fn matrix1_mut(&mut self) -> &mut Matrix3x4<f32>

Transform matrix 1 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn matrix2_mut(&mut self) -> &mut Matrix3x4<f32>

Transform matrix 2 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn matrix3_mut(&mut self) -> &mut Matrix3x4<f32>

Transform matrix 3 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn i_matrix_index_mut(&mut self) -> &mut i32

Matrix index in hierarchy.

Source

pub fn i_parent_matrix_index_mut(&mut self) -> &mut i32

Parent matrix index for hierarchical transforms.

Source

pub fn sz_padding_mut(&mut self) -> &mut Vec<u8> ⓘ

Additional padding bytes (variable length).

Source

pub fn attachment_points_mut(&mut self) -> &mut Vec<AttachmentPointEntry>

Named attachment points for weapons, effects, banners, etc.

Source

pub fn textures_mut(&mut self) -> &mut Vec<Texture>

Texture list with type and path for each texture.

Source

pub fn params_string_mut(&mut self) -> &mut Vec<(i32, String)>

String shader parameters (index, value pairs).

Source

pub fn params_f32_mut(&mut self) -> &mut Vec<(i32, f32)>

Float shader parameters (index, value pairs).

Source

pub fn params_i32_mut(&mut self) -> &mut Vec<(i32, i32)>

Integer shader parameters (index, value pairs).

Source

pub fn params_vector4df32_mut(&mut self) -> &mut Vec<(i32, Vector4<f32>)>

Vector4 shader parameters (index, value pairs).

Source

pub fn uk_7_mut(&mut self) -> &mut Vec<Uk7>

Cloth physics data section 1 (cloth materials only, format undocumented).

Source

pub fn uk_8_mut(&mut self) -> &mut Vec<Uk8>

Cloth physics data section 2 (cloth materials only, format undocumented).

Source

pub fn uk_9_mut(&mut self) -> &mut Vec<Uk9>

Cloth physics data section 3 (cloth materials only, format undocumented).

Source§

impl Material

Source

pub fn set_vertex_format(&mut self, val: VertexFormat) -> &mut Self

Vertex format determining vertex data layout.

Source

pub fn set_name(&mut self, val: String) -> &mut Self

Material name (human-readable identifier).

Source

pub fn set_name2(&mut self, val: String) -> &mut Self

Second name, only in materials of types 56 and 57: the name of the mesh followed by a suffix, like burning or rain.

Source

pub fn set_name_padding(&mut self, val: Vec<u8>) -> &mut Self

Bytes found after the end of name in its padded field, usually leftovers of the program that wrote the file. They’re kept so the file is written back as it was.

Source

pub fn set_uk_1(&mut self, val: u32) -> &mut Self

Unknown field 1 (only in RsTerrain and projected decal materials).

Source

pub fn set_uk_2(&mut self, val: u32) -> &mut Self

Unknown field 2 (only in RsTerrain and projected decal materials).

Source

pub fn set_uk_3(&mut self, val: u32) -> &mut Self

Unknown field 3 (only in RsTerrain and projected decal materials).

Source

pub fn set_uk_4(&mut self, val: u32) -> &mut Self

Unknown field 4 (only in RsTerrain and projected decal materials).

Source

pub fn set_uk_5(&mut self, val: u32) -> &mut Self

Unknown field 5 (only in RsTerrain and projected decal materials).

Source

pub fn set_uk_6(&mut self, val: u32) -> &mut Self

Unknown field 6 (only in RsTerrain and projected decal materials).

Source

pub fn set_texture_directory(&mut self, val: String) -> &mut Self

Directory path for texture files (relative to game data directory).

Source

pub fn set_filters(&mut self, val: String) -> &mut Self

Filter settings (NOT part of file format, runtime-only).

Source

pub fn set_padding_byte0(&mut self, val: u8) -> &mut Self

Padding byte 0 (alignment/reserved).

Source

pub fn set_padding_byte1(&mut self, val: u8) -> &mut Self

Padding byte 1 (alignment/reserved).

Source

pub fn set_v_pivot(&mut self, val: Vector3<f32>) -> &mut Self

Pivot point for transformations.

Source

pub fn set_decal_center(&mut self, val: Vector3<f32>) -> &mut Self

Center of the box a projected decal is projected in.

Source

pub fn set_decal_size(&mut self, val: Vector3<f32>) -> &mut Self

Size of the box a projected decal is projected in.

Source

pub fn set_sphere_center(&mut self, val: Vector3<f32>) -> &mut Self

Center of the sphere around a collision shape.

Source

pub fn set_sphere_radius(&mut self, val: f32) -> &mut Self

Radius of the sphere around a collision shape.

Source

pub fn set_cloth_bones(&mut self, val: Vec<ClothBone>) -> &mut Self

Bones of the cloth simulation of weighted cloth materials.

Source

pub fn set_rope(&mut self, val: Rope) -> &mut Self

Simulation data of rope materials.

Source

pub fn set_matrix1(&mut self, val: Matrix3x4<f32>) -> &mut Self

Transform matrix 1 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn set_matrix2(&mut self, val: Matrix3x4<f32>) -> &mut Self

Transform matrix 2 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn set_matrix3(&mut self, val: Matrix3x4<f32>) -> &mut Self

Transform matrix 3 (3x4, implicit 4th row: [0, 0, 0, 1]).

Source

pub fn set_i_matrix_index(&mut self, val: i32) -> &mut Self

Matrix index in hierarchy.

Source

pub fn set_i_parent_matrix_index(&mut self, val: i32) -> &mut Self

Parent matrix index for hierarchical transforms.

Source

pub fn set_sz_padding(&mut self, val: Vec<u8>) -> &mut Self

Additional padding bytes (variable length).

Source

pub fn set_attachment_points( &mut self, val: Vec<AttachmentPointEntry>, ) -> &mut Self

Named attachment points for weapons, effects, banners, etc.

Source

pub fn set_textures(&mut self, val: Vec<Texture>) -> &mut Self

Texture list with type and path for each texture.

Source

pub fn set_params_string(&mut self, val: Vec<(i32, String)>) -> &mut Self

String shader parameters (index, value pairs).

Source

pub fn set_params_f32(&mut self, val: Vec<(i32, f32)>) -> &mut Self

Float shader parameters (index, value pairs).

Source

pub fn set_params_i32(&mut self, val: Vec<(i32, i32)>) -> &mut Self

Integer shader parameters (index, value pairs).

Source

pub fn set_params_vector4df32( &mut self, val: Vec<(i32, Vector4<f32>)>, ) -> &mut Self

Vector4 shader parameters (index, value pairs).

Source

pub fn set_uk_7(&mut self, val: Vec<Uk7>) -> &mut Self

Cloth physics data section 1 (cloth materials only, format undocumented).

Source

pub fn set_uk_8(&mut self, val: Vec<Uk8>) -> &mut Self

Cloth physics data section 2 (cloth materials only, format undocumented).

Source

pub fn set_uk_9(&mut self, val: Vec<Uk9>) -> &mut Self

Cloth physics data section 3 (cloth materials only, format undocumented).

Source§

impl Material

Source

pub fn read<R: ReadBytes>( data: &mut R, version: u32, mtype: MaterialType, ) -> Result<Self>

Reads a material from binary data based on the material type.

Different material types have different binary layouts, which may change between versions of the RigidModel format. This function dispatches to the appropriate reader.

§Errors

Returns RLibError::DecodingRigidModelUnsupportedMaterialType if the material type is not supported.

Source

pub fn write<W: WriteBytes>( &self, buffer: &mut W, version: u32, mtype: MaterialType, ) -> Result<()>

Writes a material to binary data based on the material type.

Different material types have different binary layouts, which may change between versions of the RigidModel format. This function dispatches to the appropriate writer.

§Errors

Returns RLibError::DecodingRigidModelUnsupportedMaterialType if the material type is not supported.

Trait Implementations§

Source§

impl Clone for Material

Source§

fn clone(&self) -> Material

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Material

Source§

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

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

impl Default for Material

Source§

fn default() -> Material

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

impl<'de> Deserialize<'de> for Material

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

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

impl PartialEq for Material

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl Serialize for Material

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

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

impl StructuralPartialEq for Material

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.