pingora_core::protocols

Trait Peek

Source
pub trait Peek {
    // Provided method
    fn try_peek<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        _buf: &'life1 mut [u8],
    ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

The ability peek data before consuming it

Provided Methods§

Source

fn try_peek<'life0, 'life1, 'async_trait>( &'life0 mut self, _buf: &'life1 mut [u8], ) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Peek data but not consuming it. This call should block until some data is sent. Return false if peeking is not supported/allowed.

Implementations on Foreign Types§

Source§

impl Peek for Mock

Source§

impl Peek for DuplexStream

Source§

impl<T> Peek for Cursor<T>

Implementors§

Source§

impl Peek for Stream

Source§

impl<S> Peek for SslStream<S>