Struct ServerTransactionData

Source
pub struct ServerTransactionData {
    pub id: TransactionKey,
    pub state: Arc<AtomicTransactionState>,
    pub request: Arc<Mutex<Request>>,
    pub last_response: Arc<Mutex<Option<Response>>>,
    pub remote_addr: SocketAddr,
    pub transport: Arc<dyn Transport>,
    pub events_tx: Sender<TransactionEvent>,
    pub cmd_tx: CommandSender,
    pub cmd_rx: Arc<Mutex<CommandReceiver>>,
    pub event_loop_handle: Arc<Mutex<Option<JoinHandle<()>>>>,
    pub timer_config: TimerSettings,
}
Expand description

Common data structure for both INVITE and non-INVITE server transactions.

This structure contains all the state required for implementing the server transaction state machines defined in RFC 3261 Section 17.2. It includes:

  • Identity information (transaction key)
  • State tracking (current transaction state)
  • Message storage (original request, last response)
  • Communication channels (transport, event channels, command channels)
  • Timer configuration

Both ServerInviteTransaction and ServerNonInviteTransaction use this structure as their core data store, while implementing different behavior around it.

Fields§

§id: TransactionKey

Transaction ID based on RFC 3261 transaction matching rules

§state: Arc<AtomicTransactionState>

Current transaction state (Trying/Proceeding, Completed, Confirmed, Terminated)

§request: Arc<Mutex<Request>>

Original request that initiated this transaction

§last_response: Arc<Mutex<Option<Response>>>

Last response sent by this transaction

§remote_addr: SocketAddr

Remote address to which responses are sent

§transport: Arc<dyn Transport>

Transport layer for sending SIP messages

§events_tx: Sender<TransactionEvent>

Channel for sending events to the Transaction User (TU)

§cmd_tx: CommandSender

Channel for sending commands to the transaction’s event loop

§cmd_rx: Arc<Mutex<CommandReceiver>>

Channel for receiving commands in the transaction’s event loop

§event_loop_handle: Arc<Mutex<Option<JoinHandle<()>>>>

Handle to the transaction’s event loop task

§timer_config: TimerSettings

Configuration for transaction timers (T1, T2, etc.)

Trait Implementations§

Source§

impl AsRefKey for ServerTransactionData

Allows access to the transaction key. Required by the transaction runner for identification and logging.

Source§

fn as_ref_key(&self) -> &TransactionKey

Returns a reference to the transaction’s key.
Source§

impl AsRefState for ServerTransactionData

Allows access to the transaction state. Required by the transaction runner to manage state transitions.

Source§

fn as_ref_state(&self) -> &Arc<AtomicTransactionState>

Returns a reference to the transaction’s state storage.
Source§

impl Debug for ServerTransactionData

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for ServerTransactionData

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl HasCommandSender for ServerTransactionData

Provides access to the command channel. Required by the transaction runner to send commands to itself.

Source§

fn get_self_command_sender(&self) -> Sender<InternalTransactionCommand>

Returns the channel sender for sending commands to this transaction.
Source§

impl HasTransactionEvents for ServerTransactionData

Provides access to the event channel. Required by the transaction runner to send events to the Transaction User.

Source§

fn get_tu_event_sender(&self) -> Sender<TransactionEvent>

Returns the channel sender for communicating with the TU.
Source§

impl HasTransport for ServerTransactionData

Provides access to the transport layer. Required by the transaction runner to send messages.

Source§

fn get_transport_layer(&self) -> Arc<dyn Transport>

Returns a reference to the transport layer implementation.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,