Struct segment_rs::connection::Connection
source · [−]pub struct Connection { /* private fields */ }
Expand description
Represents a Segment connection
Implementations
sourceimpl 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 RefUnwindSafe for Connection
impl Send for Connection
impl Sync for Connection
impl Unpin for Connection
impl UnwindSafe for Connection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more