pub struct Connection { /* private fields */ }Expand description
§Connection
This struct is a helpful struct to handle the nitty gritty of connections, such as reading and writing to the stream
Implementations§
Source§impl Connection
impl Connection
Sourcepub fn new(connection_type: ConnectionType, read_buffer_size: usize) -> Self
pub fn new(connection_type: ConnectionType, read_buffer_size: usize) -> Self
§New
Create a new connection handler from a TcpStream
Sourcepub async fn read_to_string(&mut self) -> Result<String, &'static str>
pub async fn read_to_string(&mut self) -> Result<String, &'static str>
§Read To String
Read the TcpStream to a String
Auto Trait Implementations§
impl !Freeze for Connection
impl !RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more