Struct ttf_parser::parser::Stream [−][src]
pub struct Stream<'a> { /* fields omitted */ }
Expand description
A streaming binary parser.
Implementations
impl<'a> Stream<'a>
[src]
impl<'a> Stream<'a>
[src]pub fn new_at(data: &'a [u8], offset: usize) -> Option<Self>
[src]
pub fn new_at(data: &'a [u8], offset: usize) -> Option<Self>
[src]Creates a new Stream
parser at offset.
Returns None
when offset
is out of bounds.
pub fn jump_to_end(&mut self)
[src]
pub fn jump_to_end(&mut self)
[src]Jumps to the end of the stream.
Useful to indicate that we parsed all the data.
pub fn tail(&self) -> Option<&'a [u8]>
[src]
pub fn tail(&self) -> Option<&'a [u8]>
[src]Returns the trailing data.
Returns None
when Stream
is reached the end.
pub fn advance_checked(&mut self, len: usize) -> Option<()>
[src]
pub fn advance_checked(&mut self, len: usize) -> Option<()>
[src]Advances by the specified len
and checks for bounds.
pub fn read<T: FromData>(&mut self) -> Option<T>
[src]
pub fn read<T: FromData>(&mut self) -> Option<T>
[src]Parses the type from the steam.
Returns None
when there is not enough data left in the stream
or the type parsing failed.
pub fn read_at<T: FromData>(data: &[u8], offset: usize) -> Option<T>
[src]
pub fn read_at<T: FromData>(data: &[u8], offset: usize) -> Option<T>
[src]Parses the type from the steam at offset.
pub fn read_array16<T: FromData>(
&mut self,
count: u16
) -> Option<LazyArray16<'a, T>>
[src]
pub fn read_array16<T: FromData>(
&mut self,
count: u16
) -> Option<LazyArray16<'a, T>>
[src]Reads the next count
types as a slice.
pub fn read_array32<T: FromData>(
&mut self,
count: u32
) -> Option<LazyArray32<'a, T>>
[src]
pub fn read_array32<T: FromData>(
&mut self,
count: u32
) -> Option<LazyArray32<'a, T>>
[src]Reads the next count
types as a slice.
Trait Implementations
impl<'a> Copy for Stream<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Stream<'a>
impl<'a> Send for Stream<'a>
impl<'a> Sync for Stream<'a>
impl<'a> Unpin for Stream<'a>
impl<'a> UnwindSafe for Stream<'a>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more