Struct sequoia_openpgp::parse::Cookie[][src]

pub struct Cookie { /* fields omitted */ }

Private state used by the PacketParser.

This is not intended to be used. It is possible to explicitly create Cookie instances using its Default implementation for low-level interfacing with parsing code.

Trait Implementations

impl BufferedReader<Cookie> for Reader<'_>[src]

fn buffer(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns a reference to the internal buffer. Read more

fn data(&mut self, amount: usize) -> Result<&[u8]>[src]

Ensures that the internal buffer has at least amount bytes of data, and returns it. Read more

fn data_hard(&mut self, amount: usize) -> Result<&[u8]>[src]

Like data(), but returns an error if there is not at least amount bytes available. Read more

fn consume(&mut self, amount: usize) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Consumes some of the data. Read more

fn data_consume(&mut self, amount: usize) -> Result<&[u8]>[src]

A convenience function that combines data() and consume(). Read more

fn data_consume_hard(&mut self, amount: usize) -> Result<&[u8]>[src]

A convenience function that effectively combines data_hard() and consume(). Read more

fn get_mut(&mut self) -> Option<&mut dyn BufferedReader<Cookie>>[src]

Returns a mutable reference to the inner BufferedReader, if any. Read more

fn get_ref(&self) -> Option<&dyn BufferedReader<Cookie>>[src]

Returns a reference to the inner BufferedReader, if any.

fn into_inner<'b>(
    self: Box<Self>
) -> Option<Box<dyn BufferedReader<Cookie> + 'b>> where
    Self: 'b, 
[src]

Returns the underlying reader, if any. Read more

fn cookie_set(&mut self, cookie: Cookie) -> Cookie[src]

Sets the BufferedReader’s cookie and returns the old value.

fn cookie_ref(&self) -> &Cookie[src]

Returns a reference to the BufferedReader’s cookie.

fn cookie_mut(&mut self) -> &mut Cookie[src]

Returns a mutable reference to the BufferedReader’s cookie.

fn data_eof(&mut self) -> Result<&[u8], Error>[src]

Returns all of the data until EOF. Like data(), this does not actually consume the data that is read. Read more

fn eof(&mut self) -> bool[src]

Checks whether the end of the stream is reached.

fn consummated(&mut self) -> bool[src]

Checks whether this reader is consummated. Read more

fn read_be_u16(&mut self) -> Result<u16, Error>[src]

A convenience function for reading a 16-bit unsigned integer in big endian format. Read more

fn read_be_u32(&mut self) -> Result<u32, Error>[src]

A convenience function for reading a 32-bit unsigned integer in big endian format. Read more

fn read_to(&mut self, terminal: u8) -> Result<&[u8], Error>[src]

Reads until either terminal is encountered or EOF. Read more

fn drop_until(&mut self, terminals: &[u8]) -> Result<usize, Error>[src]

Discards the input until one of the bytes in terminals is encountered. Read more

fn drop_through(
    &mut self,
    terminals: &[u8],
    match_eof: bool
) -> Result<(Option<u8>, usize), Error>
[src]

Discards the input until one of the bytes in terminals is encountered. Read more

fn steal(&mut self, amount: usize) -> Result<Vec<u8, Global>, Error>[src]

Like data_consume_hard(), but returns the data in a caller-owned buffer. Read more

fn steal_eof(&mut self) -> Result<Vec<u8, Global>, Error>[src]

Like steal(), but instead of stealing a fixed number of bytes, steals all of the data until the end of file. Read more

fn drop_eof(&mut self) -> Result<bool, Error>[src]

Like steal_eof(), but instead of returning the data, the data is discarded. Read more

fn dump(&self, sink: &mut dyn Write) -> Result<(), Error>[src]

A helpful debugging aid to pretty print a Buffered Reader stack. Read more

fn as_boxed<'a>(self) -> Box<dyn BufferedReader<C> + 'a, Global>

Notable traits for Box<R, Global>

impl<R> Read for Box<R, Global> where
    R: Read + ?Sized
impl<W> Write for Box<W, Global> where
    W: Write + ?Sized
impl<F, A> Future for Box<F, A> where
    A: Allocator + 'static,
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
    I: Iterator + ?Sized,
    A: Allocator
type Item = <I as Iterator>::Item;
where
    Self: 'a, 
[src]

Boxes the reader.

impl<'a> BufferedReader<Cookie> for PacketParser<'a>[src]

This interface allows a caller to read the content of a PacketParser using the BufferedReader interface. This is essential to supporting streaming operation.

Note: it is safe to mix the use of the std::io::Read and BufferedReader interfaces.

fn buffer(&self) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Returns a reference to the internal buffer. Read more

fn data(&mut self, amount: usize) -> Result<&[u8]>[src]

Ensures that the internal buffer has at least amount bytes of data, and returns it. Read more

fn data_hard(&mut self, amount: usize) -> Result<&[u8]>[src]

Like data(), but returns an error if there is not at least amount bytes available. Read more

fn data_eof(&mut self) -> Result<&[u8]>[src]

Returns all of the data until EOF. Like data(), this does not actually consume the data that is read. Read more

fn consume(&mut self, amount: usize) -> &[u8]

Notable traits for &'_ [u8]

impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
[src]

Consumes some of the data. Read more

fn data_consume(&mut self, amount: usize) -> Result<&[u8]>[src]

A convenience function that combines data() and consume(). Read more

fn data_consume_hard(&mut self, amount: usize) -> Result<&[u8]>[src]

A convenience function that effectively combines data_hard() and consume(). Read more

fn steal(&mut self, amount: usize) -> Result<Vec<u8>>[src]

Like data_consume_hard(), but returns the data in a caller-owned buffer. Read more

fn steal_eof(&mut self) -> Result<Vec<u8>>[src]

Like steal(), but instead of stealing a fixed number of bytes, steals all of the data until the end of file. Read more

fn get_mut(&mut self) -> Option<&mut dyn BufferedReader<Cookie>>[src]

Returns a mutable reference to the inner BufferedReader, if any. Read more

fn get_ref(&self) -> Option<&dyn BufferedReader<Cookie>>[src]

Returns a reference to the inner BufferedReader, if any.

fn into_inner<'b>(
    self: Box<Self>
) -> Option<Box<dyn BufferedReader<Cookie> + 'b>> where
    Self: 'b, 
[src]

Returns the underlying reader, if any. Read more

fn cookie_set(&mut self, cookie: Cookie) -> Cookie[src]

Sets the BufferedReader’s cookie and returns the old value.

fn cookie_ref(&self) -> &Cookie[src]

Returns a reference to the BufferedReader’s cookie.

fn cookie_mut(&mut self) -> &mut Cookie[src]

Returns a mutable reference to the BufferedReader’s cookie.

fn eof(&mut self) -> bool[src]

Checks whether the end of the stream is reached.

fn consummated(&mut self) -> bool[src]

Checks whether this reader is consummated. Read more

fn read_be_u16(&mut self) -> Result<u16, Error>[src]

A convenience function for reading a 16-bit unsigned integer in big endian format. Read more

fn read_be_u32(&mut self) -> Result<u32, Error>[src]

A convenience function for reading a 32-bit unsigned integer in big endian format. Read more

fn read_to(&mut self, terminal: u8) -> Result<&[u8], Error>[src]

Reads until either terminal is encountered or EOF. Read more

fn drop_until(&mut self, terminals: &[u8]) -> Result<usize, Error>[src]

Discards the input until one of the bytes in terminals is encountered. Read more

fn drop_through(
    &mut self,
    terminals: &[u8],
    match_eof: bool
) -> Result<(Option<u8>, usize), Error>
[src]

Discards the input until one of the bytes in terminals is encountered. Read more

fn drop_eof(&mut self) -> Result<bool, Error>[src]

Like steal_eof(), but instead of returning the data, the data is discarded. Read more

fn dump(&self, sink: &mut dyn Write) -> Result<(), Error>[src]

A helpful debugging aid to pretty print a Buffered Reader stack. Read more

fn as_boxed<'a>(self) -> Box<dyn BufferedReader<C> + 'a, Global>

Notable traits for Box<R, Global>

impl<R> Read for Box<R, Global> where
    R: Read + ?Sized
impl<W> Write for Box<W, Global> where
    W: Write + ?Sized
impl<F, A> Future for Box<F, A> where
    A: Allocator + 'static,
    F: Future + Unpin + ?Sized
type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
    I: Iterator + ?Sized,
    A: Allocator
type Item = <I as Iterator>::Item;
where
    Self: 'a, 
[src]

Boxes the reader.

impl Debug for Cookie[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Cookie[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

Auto Trait Implementations

impl !RefUnwindSafe for Cookie

impl Send for Cookie

impl Sync for Cookie

impl Unpin for Cookie

impl !UnwindSafe for Cookie

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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.

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

Performs the conversion.

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.

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

Performs the conversion.