Struct PropertyReader

Source
pub struct PropertyReader<'fdt> { /* private fields */ }
Expand description

A property data reader.

It reads data from the beginning to the end. Each time a call to PropertyReader::read is issued, the inner cursor will advance by the size of the type being read.

Implementations§

Source§

impl<'fdt> PropertyReader<'fdt>

Source

pub unsafe fn read<P>(&mut self) -> Option<P::Output>
where P: PropertyParser,

Reads a property as a P. If the remaining property size is smaller than the size of P, None is returned.

§Safety

P should indeed be the type contained by the property at the given offset.

Trait Implementations§

Source§

impl<'fdt> From<&FdtProperty<'fdt>> for PropertyReader<'fdt>

Source§

fn from(prop: &FdtProperty<'fdt>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'fdt> Freeze for PropertyReader<'fdt>

§

impl<'fdt> RefUnwindSafe for PropertyReader<'fdt>

§

impl<'fdt> !Send for PropertyReader<'fdt>

§

impl<'fdt> !Sync for PropertyReader<'fdt>

§

impl<'fdt> Unpin for PropertyReader<'fdt>

§

impl<'fdt> UnwindSafe for PropertyReader<'fdt>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.