[][src]Struct ub::deserialize::File

pub struct File<'a, R: Read + Seek> { /* fields omitted */ }

A parsed file. Contains a reference where in the reader the file is located, implements Read, and contains a PathBuf

Implementations

impl<'a, R: Read + Seek> File<'a, R>[src]

#[must_use]pub fn path(&self) -> &Path[src]

Get a reference of the path this file is pointing at.

#[must_use]pub fn into_path(self) -> PathBuf[src]

Discards all information and return path. I dunno if this is useful...

#[must_use]pub fn size(&self) -> u64[src]

Gets the size of this file.

pub fn align(&mut self) -> Result<()>[src]

Aligns the underlying reader to the position we last read at. Can be used to continue reading a file.

Errors

Same as [fs::File::seek()]

pub fn align_to_start(&mut self) -> Result<()>[src]

Aligns the underlying reader to the start of this file, to start over and read it from the start.

Errors

Same as [fs::File::seek()]

Trait Implementations

impl<'a, R: Debug + Read + Seek> Debug for File<'a, R>[src]

impl<'a, R: Read + Seek> Read for File<'a, R>[src]

impl<'a, R: Read + Seek> Seek for File<'a, R>[src]

Auto Trait Implementations

impl<'a, R> !RefUnwindSafe for File<'a, R>[src]

impl<'a, R> !Send for File<'a, R>[src]

impl<'a, R> !Sync for File<'a, R>[src]

impl<'a, R> Unpin for File<'a, R>[src]

impl<'a, R> !UnwindSafe for File<'a, R>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.