Struct sip2::Connection
source · [−]pub struct Connection { /* private fields */ }Expand description
Manages a TCP connection to a SIP server and handles message sending and receiving.
Implementations
sourceimpl Connection
impl Connection
sourcepub fn new(sip_host: &str) -> Result<Self, Error>
pub fn new(sip_host: &str) -> Result<Self, Error>
Creates a new SIP client and opens the TCP connection to the server
sip_host- SIP server host/ip and port- E.g. “127.0.0.1:6001”
use sip2::Connection;
assert_eq!(Connection::new("JUNK0+..-*z$@").is_err(), true);pub fn new_from_stream(tcp_stream: TcpStream) -> Self
sourcepub fn disconnect(&self) -> Result<(), Error>
pub fn disconnect(&self) -> Result<(), Error>
Shutdown the TCP connection with the SIP server.
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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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