pub struct ServerTransaction { /* private fields */ }Expand description
A server transaction.
Implementations§
Source§impl ServerTransaction
impl ServerTransaction
Sourcepub fn new(
request: Request,
reliability: Reliability,
timers: Timers,
) -> (Self, Vec<Output>)
pub fn new( request: Request, reliability: Reliability, timers: Timers, ) -> (Self, Vec<Output>)
Start a server transaction from a received request.
The request is handed to the transaction user exactly once. Every later copy of it is answered by the transaction itself — which is the whole point of the layer, because a UDP peer that misses one response resends the request every T1, and an application that saw each copy would process the same REGISTER seven times.
Sourcepub fn state(&self) -> ServerState
pub fn state(&self) -> ServerState
The current state.
Sourcepub fn on_request(&mut self, request: &Request) -> Vec<Output>
pub fn on_request(&mut self, request: &Request) -> Vec<Output>
Feed in a request that matched this transaction.
This is either a retransmission of the original or, for an INVITE, an ACK.
Sourcepub fn on_tu_response(&mut self, response: Response) -> Vec<Output>
pub fn on_tu_response(&mut self, response: Response) -> Vec<Output>
The transaction user wants to send a response.
Sourcepub fn on_transport_error(&mut self) -> Vec<Output>
pub fn on_transport_error(&mut self) -> Vec<Output>
The transport could not deliver a response.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ServerTransaction
impl RefUnwindSafe for ServerTransaction
impl Send for ServerTransaction
impl Sync for ServerTransaction
impl Unpin for ServerTransaction
impl UnsafeUnpin for ServerTransaction
impl UnwindSafe for ServerTransaction
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