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§
Sourcefn connect(&mut self) -> impl Future<Output = Result<(), ProFuzzError>>
fn connect(&mut self) -> impl Future<Output = Result<(), ProFuzzError>>
Creates a new instance of the transport layer
§Errors
Sourcefn close(&mut self) -> impl Future<Output = Result<(), ProFuzzError>>
fn close(&mut self) -> impl Future<Output = Result<(), ProFuzzError>>
Closes the current connection to the target
§Errors
Sourcefn read(
&mut self,
buf: &mut [u8],
) -> impl Future<Output = Result<usize, ProFuzzError>>
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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".