pub struct Connection { /* private fields */ }
Expand description
Represents a Segment connection
Implementations§
Source§impl Connection
impl Connection
Sourcepub async fn connect(
options: &ConnectionOptions,
) -> Result<Self, ConnectionError>
pub async fn connect( options: &ConnectionOptions, ) -> Result<Self, ConnectionError>
Creates a new connection from a TcpStream
Sourcepub async fn read_frame(&mut self) -> Result<Frame, ConnectionError>
pub async fn read_frame(&mut self) -> Result<Frame, ConnectionError>
Reads a frame from the connection and parses it
Sourcepub async fn write_frame(
&mut self,
frame: &Frame,
) -> Result<(), ConnectionError>
pub async fn write_frame( &mut self, frame: &Frame, ) -> Result<(), ConnectionError>
Writes a frame to the connection
Trait Implementations§
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