[−][src]Struct binread::PosValue
A wrapper where the position it was read from is stored alongside the value
use binread::{BinRead, PosValue, BinReaderExt, io::Cursor}; #[derive(BinRead)] struct MyType { a: u16, b: PosValue<u8> } let val = Cursor::new(b"\xFF\xFE\xFD").read_be::<MyType>().unwrap(); assert_eq!(val.b.pos, 2); assert_eq!(*val.b, 0xFD);
Fields
val: T
pos: u64
Trait Implementations
impl<T: BinRead> BinRead for PosValue<T>
[src]
type Args = T::Args
The type of arguments needed to be supplied in order to read this type, usually a tuple. Read more
fn read_options<R: Read + Seek>(
reader: &mut R,
options: &ReadOptions,
args: T::Args
) -> BinResult<Self>
[src]
reader: &mut R,
options: &ReadOptions,
args: T::Args
) -> BinResult<Self>
fn after_parse<R: Read + Seek>(
&mut self,
reader: &mut R,
options: &ReadOptions,
args: Self::Args
) -> BinResult<()>
[src]
&mut self,
reader: &mut R,
options: &ReadOptions,
args: Self::Args
) -> BinResult<()>
fn read<R: Read + Seek>(reader: &mut R) -> BinResult<Self>
[src]
fn read_args<R: Read + Seek>(
reader: &mut R,
args: Self::Args
) -> BinResult<Self>
[src]
reader: &mut R,
args: Self::Args
) -> BinResult<Self>
fn args_default() -> Option<Self::Args>
[src]
impl<T: Clone> Clone for PosValue<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for PosValue<T>
[src]
impl<T> Deref for PosValue<T>
[src]
impl<T> DerefMut for PosValue<T>
[src]
impl<U, T: PartialEq<U>> PartialEq<U> for PosValue<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for PosValue<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for PosValue<T> where
T: Send,
T: Send,
impl<T> Sync for PosValue<T> where
T: Sync,
T: Sync,
impl<T> Unpin for PosValue<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for PosValue<T> where
T: UnwindSafe,
T: UnwindSafe,
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> 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>,