Enum gut::io::vtk::model::IOBuffer[]

pub enum IOBuffer {
    Bit(Vec<u8, Global>),
    U8(Vec<u8, Global>),
    I8(Vec<i8, Global>),
    U16(Vec<u16, Global>),
    I16(Vec<i16, Global>),
    U32(Vec<u32, Global>),
    I32(Vec<i32, Global>),
    U64(Vec<u64, Global>),
    I64(Vec<i64, Global>),
    F32(Vec<f32, Global>),
    F64(Vec<f64, Global>),
}
Expand description

Numeric data buffer.

This represents any loaded data such as attributes, cell indices or point coordinates.

Variants

Bit(Vec<u8, Global>)

Bit array is stored in 8 bit chunks.

Tuple Fields of Bit

0: Vec<u8, Global>
U8(Vec<u8, Global>)

Vector of unsigned bytes.

Tuple Fields of U8

0: Vec<u8, Global>
I8(Vec<i8, Global>)

Vector of signed bytes.

Tuple Fields of I8

0: Vec<i8, Global>
U16(Vec<u16, Global>)

Vector of unsigned short integers u16.

Tuple Fields of U16

0: Vec<u16, Global>
I16(Vec<i16, Global>)

Vector of signed short integers i16.

Tuple Fields of I16

0: Vec<i16, Global>
U32(Vec<u32, Global>)

Vector of unsigned integers u32.

Tuple Fields of U32

0: Vec<u32, Global>
I32(Vec<i32, Global>)

Vector of signed integers i32.

Tuple Fields of I32

0: Vec<i32, Global>
U64(Vec<u64, Global>)

Vector of unsigned long integers u64.

Tuple Fields of U64

0: Vec<u64, Global>
I64(Vec<i64, Global>)

Vector of signed long integers i64.

Tuple Fields of I64

0: Vec<i64, Global>
F32(Vec<f32, Global>)

Vector of single precision floats.

Tuple Fields of F32

0: Vec<f32, Global>
F64(Vec<f64, Global>)

Vector of double precision floats.

Tuple Fields of F64

0: Vec<f64, Global>

Implementations

Constructs an IOBuffer from a given generic Vec<T>.

This function will deduce the type T, and if T is none of the supported types, will convert it to f64.

Panics

This function will panic if T cannot be converted to an f64.

Returns the scalar type represented by this buffer.

Returns the number of bytes occupied by one scalar stored in this array.

In case of a Bit array, this returns 1.

Returns the length of the buffer.

Returns the number of bytes held by this buffer.

Checks if the buffer is empty.

Converts this IOBuffer into an array of bytes with a 64-bit size prefix.

The size of the scalar type in bytes is stored as a 64-bit integer at the very beginning.

This is how VTK data arrays store data in the XML files.

Converts this IOBuffer into an array of bytes with a 32-bit size prefix.

The size of the scalar type in bytes is stored as a 32-bit integer at the very beginning.

This is how VTK data arrays store data in the XML files.

Constructs an IOBuffer from a slice of bytes and a corresponding scalar type.

Constructs an IOBuffer from a Vec of bytes and a corresponding scalar type.

Construct an IOBuffer with u8 elements from the given slice of bytes.

Construct an IOBuffer with i8 elements from the given slice of bytes.

Construct an IOBuffer with u16 elements from the given slice of bytes.

Construct an IOBuffer with i16 elements from the given slice of bytes.

Construct an IOBuffer with u32 elements from the given slice of bytes.

Construct an IOBuffer with i32 elements from the given slice of bytes.

Construct an IOBuffer with u64 elements from the given slice of bytes.

Construct an IOBuffer with i64 elements from the given slice of bytes.

Construct an IOBuffer with f32 elements from the given slice of bytes.

Construct an IOBuffer with f64 elements from the given slice of bytes.

Construct an IOBuffer with u8 elements from the given Vec of bytes.

Construct an IOBuffer with i8 elements from the given Vec of bytes.

Construct an IOBuffer with u16 elements from the given Vec of bytes.

Construct an IOBuffer with i16 elements from the given Vec of bytes.

Construct an IOBuffer with u32 elements from the given Vec of bytes.

Construct an IOBuffer with i32 elements from the given Vec of bytes.

Construct an IOBuffer with u64 elements from the given Vec of bytes.

Construct an IOBuffer with i64 elements from the given Vec of bytes.

Construct an IOBuffer with f32 elements from the given Vec of bytes.

Construct an IOBuffer with f64 elements from the given Vec of bytes.

Returns an iterator over elements with type T.

If T is not one of u8, i8, u16, i16, u32, i32, u64, i64, f32, or f64, then None is returned.

Converts this buffer into the underlying Vec representation.

If T is not one of u8, i8, u16, i16, u32, i32, u64, i64, f32, or f64, then None is returned.

Cast a vector of numbers into a given number type T.

In case of overflow, None is returned.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

Creates a value from an iterator. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Get a slice of bytes representing Self.

Panics if the size of the given bytes slice is not equal to the size of Self.

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Performs the conversion.

Return a value at the given index. This is provided as the checked version of get that will panic if the equivalent get call is None, which typically means that the given index is out of bounds. Read more

Return a value at the given index. This is provided as the unchecked version of get that has undefined behavior when the index is out of bounds. Read more

Performs the conversion.

Return a value at the given index. This is provided as the checked version of try_isolate that will panic if the equivalent try_isolate call is None, which typically means that the given index is out of bounds. Read more

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

This method tells this type how it can be pushed to a Vec as an array.

Should always be Self

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

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

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

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

The resulting type after obtaining ownership.

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

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

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.