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 array is stored in 8 bit chunks.
Vector of unsigned bytes.
Vector of signed bytes.
Vector of unsigned short integers u16
.
Vector of signed short integers i16
.
Vector of unsigned integers u32
.
Vector of signed integers i32
.
Vector of unsigned long integers u64
.
Vector of signed long integers i64
.
Vector of single precision floats.
Vector of double precision floats.
Implementations
impl IOBuffer
impl IOBuffer
impl IOBuffer
impl IOBuffer
pub fn scalar_type(&self) -> ScalarType
pub fn scalar_type(&self) -> ScalarType
Returns the scalar type represented by this buffer.
pub fn scalar_size(&self) -> usize
pub fn scalar_size(&self) -> usize
Returns the number of bytes occupied by one scalar stored in this array.
In case of a Bit
array, this returns 1.
pub fn into_bytes_with_size(
self,
bo: ByteOrder,
compressor: Compressor,
compression_level: u32
) -> Vec<u8, Global>
pub fn into_bytes_with_size(
self,
bo: ByteOrder,
compressor: Compressor,
compression_level: u32
) -> Vec<u8, Global>
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.
pub fn into_bytes_with_size32(
self,
bo: ByteOrder,
compressor: Compressor,
compression_level: u32
) -> Vec<u8, Global>
pub fn into_bytes_with_size32(
self,
bo: ByteOrder,
compressor: Compressor,
compression_level: u32
) -> Vec<u8, Global>
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.
pub fn from_bytes(
bytes: &[u8],
scalar_type: ScalarType,
bo: ByteOrder
) -> Result<IOBuffer, Error>
pub fn from_bytes(
bytes: &[u8],
scalar_type: ScalarType,
bo: ByteOrder
) -> Result<IOBuffer, Error>
Constructs an IOBuffer
from a slice of bytes and a corresponding scalar type.
pub fn from_byte_vec(
bytes: Vec<u8, Global>,
scalar_type: ScalarType,
bo: ByteOrder
) -> Result<IOBuffer, Error>
pub fn from_byte_vec(
bytes: Vec<u8, Global>,
scalar_type: ScalarType,
bo: ByteOrder
) -> Result<IOBuffer, Error>
Constructs an IOBuffer
from a Vec
of bytes and a corresponding scalar type.
pub fn u8_from_bytes(bytes: &[u8]) -> IOBuffer
pub fn u8_from_bytes(bytes: &[u8]) -> IOBuffer
Construct an IOBuffer
with u8
elements from the given slice
of bytes.
pub fn i8_from_bytes(bytes: &[u8]) -> IOBuffer
pub fn i8_from_bytes(bytes: &[u8]) -> IOBuffer
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.
pub fn u8_from_byte_vec(bytes: Vec<u8, Global>) -> IOBuffer
pub fn u8_from_byte_vec(bytes: Vec<u8, Global>) -> IOBuffer
Construct an IOBuffer
with u8
elements from the given Vec
of bytes.
pub fn i8_from_byte_vec(bytes: Vec<u8, Global>) -> IOBuffer
pub fn i8_from_byte_vec(bytes: Vec<u8, Global>) -> IOBuffer
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.
Trait Implementations
impl From<IOBuffer> for DataArrayBase<ElementType>
impl From<IOBuffer> for DataArrayBase<ElementType>
pub fn from(buf: IOBuffer) -> DataArrayBase<ElementType>
pub fn from(buf: IOBuffer) -> DataArrayBase<ElementType>
Performs the conversion.
impl<T> From<Vec<T, Global>> for IOBuffer where
T: 'static + ToPrimitive,
impl<T> From<Vec<T, Global>> for IOBuffer where
T: 'static + ToPrimitive,
impl<T> FromIterator<T> for IOBuffer where
T: 'static + ToPrimitive,
impl<T> FromIterator<T> for IOBuffer where
T: 'static + ToPrimitive,
pub fn from_iter<I>(iter: I) -> IOBuffer where
I: IntoIterator<Item = T>,
pub fn from_iter<I>(iter: I) -> IOBuffer where
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
impl StructuralPartialEq for IOBuffer
Auto Trait Implementations
impl RefUnwindSafe for IOBuffer
impl UnwindSafe for IOBuffer
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> CloneBytes for T where
T: 'static + Clone,
impl<T> CloneBytes for T where
T: 'static + Clone,
pub unsafe fn clone_bytes(
src: &[MaybeUninit<u8>]
) -> Box<[MaybeUninit<u8>], Global>
pub unsafe fn clone_from_bytes(
dst: &mut [MaybeUninit<u8>],
src: &[MaybeUninit<u8>]
)
pub unsafe fn clone_into_raw_bytes(
src: &[MaybeUninit<u8>],
dst: &mut [MaybeUninit<u8>]
)
impl<T> DebugBytes for T where
T: 'static + Debug,
impl<T> DebugBytes for T where
T: 'static + Debug,
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
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
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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
pub unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])
type Output = <I as GetIndex<'a, S>>::Output
fn at(&self, idx: I) -> Self::Output
fn at(&self, idx: I) -> Self::Output
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
unsafe fn at_unchecked(&self, idx: I) -> Self::Output
unsafe fn at_unchecked(&self, idx: I) -> Self::Output
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
type Output = <I as IsolateIndex<S>>::Output
pub unsafe fn isolate_unchecked(self, idx: I) -> <S as Isolate<I>>::Output
pub fn try_isolate(self, idx: I) -> Option<<S as Isolate<I>>::Output>
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>,
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>,
pub unsafe fn eq_bytes(a: &[MaybeUninit<u8>], b: &[MaybeUninit<u8>]) -> bool
impl<T, N> PushArrayToVec<N> for T where
T: Clone,
N: Array<T>,
impl<T, N> PushArrayToVec<N> for T where
T: Clone,
N: Array<T>,
pub fn push_to_vec(element: <N as Array<T>>::Array, set: &mut Vec<T, Global>)
pub fn push_to_vec(element: <N as Array<T>>::Array, set: &mut Vec<T, Global>)
This method tells this type how it can be pushed to a Vec
as an array.
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.