Struct blaze_ssl_async::stream::BlazeStream
source · pub struct BlazeStream<S> { /* private fields */ }
Expand description
Wrapping structure for wrapping Read + Write streams with a SSLv3 protocol wrapping.
Implementations
sourceimpl<S> BlazeStream<S>
impl<S> BlazeStream<S>
sourceimpl<S> BlazeStream<S>where
S: AsyncRead + AsyncWrite + Unpin,
impl<S> BlazeStream<S>where
S: AsyncRead + AsyncWrite + Unpin,
pub async fn new(value: S, mode: StreamMode) -> BlazeResult<Self>
sourcepub async fn next_message(&mut self) -> BlazeResult<Message>
pub async fn next_message(&mut self) -> BlazeResult<Message>
Attempts to take the next message form the deframer or read a new message from the underlying stream if there is no parsable messages
sourcepub async fn shutdown(&mut self) -> BlazeResult<()>
pub async fn shutdown(&mut self) -> BlazeResult<()>
Triggers a shutdown by sending a CloseNotify alert
sourcepub async fn handle_alert(&mut self, alert: AlertDescription) -> BlazeResult<()>
pub async fn handle_alert(&mut self, alert: AlertDescription) -> BlazeResult<()>
Handle the alert message provided
sourcepub fn handle_fatal(&mut self, alert: AlertDescription) -> BlazeError
pub fn handle_fatal(&mut self, alert: AlertDescription) -> BlazeError
Handle a fatal alert (Stop the connection and don’t attempt more reads/writes)
sourcepub async fn write_message(&mut self, message: Message) -> Result<()>
pub async fn write_message(&mut self, message: Message) -> Result<()>
Fragments the provided message and encrypts the contents if encryption is available writing the output to the underlying stream
sourcepub async fn alert(&mut self, alert: AlertDescription) -> BlazeResult<()>
pub async fn alert(&mut self, alert: AlertDescription) -> BlazeResult<()>
Writes an alert message and calls handle_alert
with the alert
pub async fn fatal_unexpected(&mut self) -> BlazeError
pub async fn fatal_illegal(&mut self) -> BlazeError
pub async fn alert_fatal(&mut self, alert: AlertDescription) -> BlazeError
sourcepub async fn fill_app_data(&mut self) -> Result<usize>
pub async fn fill_app_data(&mut self) -> Result<usize>
Fills the application data buffer if the buffer is empty by reading a message from the application layer
pub fn write(&mut self, buf: &[u8]) -> Result<usize>
pub async fn flush(&mut self) -> Result<()>
sourcepub async fn read(&mut self, buf: &mut [u8]) -> Result<usize>
pub async fn read(&mut self, buf: &mut [u8]) -> Result<usize>
Function for async reading data into a buffer. Will read whatever data is available. This is a replacement as to not have to implemenet AsyncRead
sourcepub async fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
pub async fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
Function for async reading data into a buffer. Will read the entire size of the buffer. This is a replacement as to not have to implemenet AsyncRead