Skip to main content

Transport

Trait Transport 

Source
pub trait Transport {
    // Required methods
    fn title(&self) -> String;
    fn connect(&mut self) -> impl Future<Output = Result<(), ProFuzzError>>;
    fn close(&mut self) -> impl Future<Output = Result<(), ProFuzzError>>;
    fn read(
        &mut self,
        buf: &mut [u8],
    ) -> impl Future<Output = Result<usize, ProFuzzError>>;
    fn write(
        &mut self,
        buf: &[u8],
    ) -> impl Future<Output = Result<(), ProFuzzError>>;
}
Expand description

Transport layer to connect to the target

Required Methods§

Source

fn title(&self) -> String

The title shown in the TUI

Source

fn connect(&mut self) -> impl Future<Output = Result<(), ProFuzzError>>

Creates a new instance of the transport layer

§Errors
Source

fn close(&mut self) -> impl Future<Output = Result<(), ProFuzzError>>

Closes the current connection to the target

§Errors
Source

fn read( &mut self, buf: &mut [u8], ) -> impl Future<Output = Result<usize, ProFuzzError>>

Read data from the target.

  • If no error happen the function must return the lenght that was read from the target.
  • If the length is 0 this means that the connection was successfully closed (e.g. for TCP a TCP RST was reseved)
§Errors
Source

fn write( &mut self, buf: &[u8], ) -> impl Future<Output = Result<(), ProFuzzError>>

Write data to the target.

§Errors

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§