[−][src]Enum nifti::Endianness
Enumerate for materializing the two kinds of machine byte order supported by Rust.
Variants
Little Endian
Big Endian
Implementations
impl Endianness
[src]
pub fn native() -> Endianness
[src]
Obtains this system's native endianness.
On this platform, the function returns Endianness::Little
.
pub fn le_iff(e: bool) -> Endianness
[src]
Obtains Little Endian if and only if the given value is true
.
Examples
let data: &[u8] = &[4, 1]; let e = Endianness::le_iff(2 + 2 == 4); assert_eq!(e.read_u16(data).unwrap(), 260); let e = Endianness::le_iff(2 + 2 >= 5); assert_eq!(e.read_u16(data).unwrap(), 1025);
pub fn be_iff(e: bool) -> Endianness
[src]
Obtains Big Endian if and only if the given value is true
.
Examples
assert_eq!(Endianness::be_iff(2 + 2 == 4), Endianness::Big); assert_eq!(Endianness::be_iff(2 + 2 >= 5), Endianness::Little);
pub fn to_opposite(self) -> Endianness
[src]
Obtains the opposite endianness: Little Endian returns Big Endian and vice versa.
Trait Implementations
impl Clone for Endianness
[src]
fn clone(&self) -> Endianness
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Endianness
[src]
impl Debug for Endianness
[src]
impl Endian for Endianness
[src]
type Opposite = Endianness
A type which can represent a byte order that is opposite to this one.
fn into_opposite(self) -> <Endianness as Endian>::Opposite
[src]
fn is_native(&self) -> bool
[src]
fn read_i16<S>(&self, src: S) -> Result<i16, Error> where
S: Read,
[src]
S: Read,
fn read_u16<S>(&self, src: S) -> Result<u16, Error> where
S: Read,
[src]
S: Read,
fn read_i32<S>(&self, src: S) -> Result<i32, Error> where
S: Read,
[src]
S: Read,
fn read_u32<S>(&self, src: S) -> Result<u32, Error> where
S: Read,
[src]
S: Read,
fn read_i64<S>(&self, src: S) -> Result<i64, Error> where
S: Read,
[src]
S: Read,
fn read_u64<S>(&self, src: S) -> Result<u64, Error> where
S: Read,
[src]
S: Read,
fn read_f32<S>(&self, src: S) -> Result<f32, Error> where
S: Read,
[src]
S: Read,
fn read_f64<S>(&self, src: S) -> Result<f64, Error> where
S: Read,
[src]
S: Read,
fn read_i128<S>(&self, src: S) -> Result<i128, Error> where
S: Read,
[src]
S: Read,
fn read_u128<S>(&self, src: S) -> Result<u128, Error> where
S: Read,
[src]
S: Read,
fn write_i16<S>(&self, src: S, v: i16) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_u16<S>(&self, src: S, v: u16) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_i32<S>(&self, src: S, v: i32) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_u32<S>(&self, src: S, v: u32) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_i64<S>(&self, src: S, v: i64) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_u64<S>(&self, src: S, v: u64) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_f32<S>(&self, src: S, v: f32) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_f64<S>(&self, src: S, v: f64) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_i128<S>(&self, src: S, v: i128) -> Result<(), Error> where
S: Write,
[src]
S: Write,
fn write_u128<S>(&self, src: S, v: u128) -> Result<(), Error> where
S: Write,
[src]
S: Write,
impl Eq for Endianness
[src]
impl From<StaticEndianness<BigEndian>> for Endianness
[src]
fn from(StaticEndianness<BigEndian>) -> Endianness
[src]
impl From<StaticEndianness<LittleEndian>> for Endianness
[src]
fn from(StaticEndianness<LittleEndian>) -> Endianness
[src]
impl Hash for Endianness
[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Endianness
[src]
fn cmp(&self, other: &Endianness) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Endianness> for Endianness
[src]
impl PartialEq<StaticEndianness<BigEndian>> for Endianness
[src]
fn eq(&self, &StaticEndianness<BigEndian>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<StaticEndianness<LittleEndian>> for Endianness
[src]
fn eq(&self, &StaticEndianness<LittleEndian>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<Endianness> for Endianness
[src]
fn partial_cmp(&self, other: &Endianness) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for Endianness
[src]
impl StructuralPartialEq for Endianness
[src]
Auto Trait Implementations
impl RefUnwindSafe for Endianness
impl Send for Endianness
impl Sync for Endianness
impl Unpin for Endianness
impl UnwindSafe for Endianness
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Scalar for T where
T: PartialEq<T> + Copy + Any + Debug,
[src]
T: PartialEq<T> + Copy + Any + Debug,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn is_in_subset(&self) -> bool
fn to_subset_unchecked(&self) -> SS
fn from_subset(element: &SS) -> SP
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,