Skip to main content

ServerTransaction

Struct ServerTransaction 

Source
pub struct ServerTransaction { /* private fields */ }
Expand description

A server transaction.

Implementations§

Source§

impl ServerTransaction

Source

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.

Source

pub fn state(&self) -> ServerState

The current state.

Source

pub fn request(&self) -> &Request

The request that created this transaction.

Source

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.

Source

pub fn on_tu_response(&mut self, response: Response) -> Vec<Output>

The transaction user wants to send a response.

Source

pub fn on_timer(&mut self, timer: Timer) -> Vec<Output>

Feed a fired timer in.

Source

pub fn on_transport_error(&mut self) -> Vec<Output>

The transport could not deliver a response.

Trait Implementations§

Source§

impl Debug for ServerTransaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.