pub struct TransportNetworkConfig { /* private fields */ }Expand description
Default network configuration for the built-in traversal-assisted transport backend.
Holds the traversal/relay server specification (traversal_servers), optional advertised
external endpoint locator (endpoint_hint), and optional local UDP ephemeral port range
(udp_port_range).
Implementations§
Source§impl TransportNetworkConfig
impl TransportNetworkConfig
Sourcepub fn new(
traversal_servers: impl Into<String>,
endpoint_hint: Option<String>,
udp_port_range: Option<UdpPortRange>,
) -> TransportNetworkConfig
pub fn new( traversal_servers: impl Into<String>, endpoint_hint: Option<String>, udp_port_range: Option<UdpPortRange>, ) -> TransportNetworkConfig
Construct a new TransportNetworkConfig from a traversal server specification string,
an optional advertised external endpoint locator, and an optional validated UdpPortRange.
Sourcepub fn with_endpoint_hint(
self,
endpoint_hint: Option<String>,
) -> TransportNetworkConfig
pub fn with_endpoint_hint( self, endpoint_hint: Option<String>, ) -> TransportNetworkConfig
Set the optional external endpoint hint advertised by this node.
Sourcepub const fn with_udp_port_range(
self,
udp_port_range: Option<UdpPortRange>,
) -> TransportNetworkConfig
pub const fn with_udp_port_range( self, udp_port_range: Option<UdpPortRange>, ) -> TransportNetworkConfig
Set the optional local UDP port range constraint [min, max].
Sourcepub fn endpoint_hint(&self) -> Option<&str>
pub fn endpoint_hint(&self) -> Option<&str>
Return the configured external endpoint hint, if any.
Sourcepub const fn udp_port_range(&self) -> Option<UdpPortRange>
pub const fn udp_port_range(&self) -> Option<UdpPortRange>
Return the configured local UDP port range constraint, if any.
Sourcepub fn traversal_servers(&self) -> &str
pub fn traversal_servers(&self) -> &str
Return the configured traversal server specification string.
Instantiate the active platform’s production SharedTransport using
initial_session_credential (falling back to the raw traversal_servers specification
when no signed credential is supplied).
Unlike Cargo feature unification, enabling rings-transport/dummy elsewhere in a workspace
dependency graph never overrides WebrtcTransport when native-webrtc is present; callers
that explicitly want the deterministic in-memory backend call Self::build_dummy_transport.
Strictly parse and instantiate the active platform’s production SharedTransport,
failing closed with crate::error::Error::IceServer if the traversal server
specification or initial_session_credential is malformed.
Sourcepub fn session_credentials_of(
transport: &Arc<dyn DynTransportInterface + Sync + Send>,
) -> Option<String>
pub fn session_credentials_of( transport: &Arc<dyn DynTransportInterface + Sync + Send>, ) -> Option<String>
Inspect the currently committed session-bound credential string on a built-in transport
(WebrtcTransport, DummyTransport, or WebSysWebrtcTransport), returning None for
custom external transports that do not carry ICE server state.
Sourcepub fn prepare_ice_server_rotation(
transport: &Arc<dyn DynTransportInterface + Sync + Send>,
credentials: String,
) -> Result<Box<dyn FnOnce()>, Error>
pub fn prepare_ice_server_rotation( transport: &Arc<dyn DynTransportInterface + Sync + Send>, credentials: String, ) -> Result<Box<dyn FnOnce()>, Error>
Phase-1 preparation for two-phase session-key rotation on a built-in ICE-backed transport:
strictly parses credentials into Vec<IceServer> and verifies that transport is a
supported built-in backend before mutating any state, returning an infallible phase-2
commit closure that atomically swaps (raw_credentials, parsed_ice_servers).
Trait Implementations§
Source§impl Clone for TransportNetworkConfig
impl Clone for TransportNetworkConfig
Source§fn clone(&self) -> TransportNetworkConfig
fn clone(&self) -> TransportNetworkConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransportNetworkConfig
impl Debug for TransportNetworkConfig
Source§impl Default for TransportNetworkConfig
impl Default for TransportNetworkConfig
Source§fn default() -> TransportNetworkConfig
fn default() -> TransportNetworkConfig
impl Eq for TransportNetworkConfig
Source§impl NodeNetworkParameters for TransportNetworkConfig
Implementation of NodeNetworkParameters for the built-in TransportNetworkConfig.
impl NodeNetworkParameters for TransportNetworkConfig
Implementation of NodeNetworkParameters for the built-in TransportNetworkConfig.
Source§fn build_transport(
&self,
delegatee_key: &DelegateeKey,
) -> Result<SharedTransport>
fn build_transport( &self, delegatee_key: &DelegateeKey, ) -> Result<SharedTransport>
Strictly derive session-signed traversal credentials from delegatee_key and construct the
platform’s SharedTransport, failing closed if any ICE/TURN URL or server public key is
malformed.
Source§fn endpoint_hint(&self) -> Option<&str>
fn endpoint_hint(&self) -> Option<&str>
Return the configured external endpoint hint, if any.
Source§fn prepare_session_key_rotation(
&self,
transport: &SharedTransport,
next_key: &DelegateeKey,
) -> Result<SessionRotationCommit>
fn prepare_session_key_rotation( &self, transport: &SharedTransport, next_key: &DelegateeKey, ) -> Result<SessionRotationCommit>
Re-sign the configured traversal server template with next_key, strictly parse the
resulting ICE server list in phase 1 without mutating transport, and return an infallible
phase-2 closure that atomically commits (raw_credentials, parsed_ice_servers).
Source§fn to_network_descriptor(&self) -> Option<NetworkConfigDescriptor>
fn to_network_descriptor(&self) -> Option<NetworkConfigDescriptor>
NetworkConfigDescriptor for lossless
serialization into ProcessorConfigSerialized, returning None if this parameter type is
purely programmatic.Source§impl PartialEq for TransportNetworkConfig
impl PartialEq for TransportNetworkConfig
impl StructuralPartialEq for TransportNetworkConfig
Auto Trait Implementations§
impl Forget for TransportNetworkConfig
impl Freeze for TransportNetworkConfig
impl Move for TransportNetworkConfig
impl RefUnwindSafe for TransportNetworkConfig
impl Send for TransportNetworkConfig
impl Sync for TransportNetworkConfig
impl Unpin for TransportNetworkConfig
impl UnsafeUnpin for TransportNetworkConfig
impl UnwindSafe for TransportNetworkConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
impl<T> MaybeSendSync for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.