pub struct HttpSignalingInfo {
pub host: Host,
pub port: u16,
}
Expand description
HTTP signaling server connection information.
HttpSignalingInfo
encapsulates the network location information needed
to connect to an HTTP-based WebRTC signaling server. This includes the
host address and port number required for establishing HTTP connections.
§Usage
This struct is used by both HTTP and HTTPS signaling methods, as well as HTTPS proxy configurations. It provides the fundamental addressing information needed to construct signaling URLs and establish connections.
§Fields
host
: The server hostname, IP address, or multiaddrport
: The TCP port number for the HTTP service
§Examples
use openmina::webrtc::Host;
use openmina::signaling_method::HttpSignalingInfo;
// IPv4 signaling server
let info = HttpSignalingInfo {
host: Host::Ipv4("192.168.1.100".parse()?),
port: 8080,
};
// Domain-based signaling server
let info = HttpSignalingInfo {
host: Host::Domain("signal.example.com".into()),
port: 443,
};
Fields§
§host: Host
The host address for the HTTP signaling server.
This can be a domain name, IPv4 address, IPv6 address, or multiaddr depending on the network configuration and addressing requirements.
port: u16
The TCP port number for the HTTP signaling server.
Standard ports are 80 for HTTP and 443 for HTTPS, but custom ports can be used depending on the server configuration.
Trait Implementations§
Source§impl BinProtRead for HttpSignalingInfo
impl BinProtRead for HttpSignalingInfo
fn binprot_read<__BinProtR: Read + ?Sized>( __binprot_r: &mut __BinProtR, ) -> Result<Self, Error>
Source§impl BinProtWrite for HttpSignalingInfo
impl BinProtWrite for HttpSignalingInfo
fn binprot_write<__BinProtW: Write>( &self, __binprot_w: &mut __BinProtW, ) -> Result<()>
Source§impl Clone for HttpSignalingInfo
impl Clone for HttpSignalingInfo
Source§fn clone(&self) -> HttpSignalingInfo
fn clone(&self) -> HttpSignalingInfo
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for HttpSignalingInfo
impl Debug for HttpSignalingInfo
Source§impl<'de> Deserialize<'de> for HttpSignalingInfo
impl<'de> Deserialize<'de> for HttpSignalingInfo
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserializes HTTP signaling info from a string.
This uses the FromStr
implementation to parse the string
representation back into an HttpSignalingInfo
instance.
The expected format is {host}/{port}
or /{host}/{port}
.
§Errors
Returns a deserialization error if the string cannot be parsed as valid HTTP signaling info (invalid host, port, or format).
Source§impl Display for HttpSignalingInfo
impl Display for HttpSignalingInfo
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Formats the HTTP signaling info as a path component string.
This creates a string representation suitable for inclusion in
signaling method URLs. The format is /{host}/{port}
where the
host and port are formatted according to their respective types.
§Example Output
- IPv4:
/192.168.1.100/8080
- Domain:
/signal.example.com/443
- IPv6:
/[::1]/8080
Source§impl From<([u8; 4], u16)> for HttpSignalingInfo
impl From<([u8; 4], u16)> for HttpSignalingInfo
Source§fn from(value: ([u8; 4], u16)) -> Self
fn from(value: ([u8; 4], u16)) -> Self
Creates HTTP signaling info from an IPv4 address and port tuple.
This convenience constructor allows easy creation of HttpSignalingInfo
from raw IPv4 address bytes and a port number.
§Parameters
value
- A tuple containing (IPv4 address bytes, port number)
§Example
let info = HttpSignalingInfo::from(([192, 168, 1, 100], 8080));
assert_eq!(info.port, 8080);
Source§impl FromStr for HttpSignalingInfo
impl FromStr for HttpSignalingInfo
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parses a string representation into HTTP signaling info.
This method parses path-like strings that contain host and port
information separated by forward slashes. The expected format is
{host}/{port}
or /{host}/{port}
.
§Format
- Input:
{host}/{port}
(leading slash optional) - Host: Domain name, IPv4, IPv6, or multiaddr format
- Port: 16-bit unsigned integer (0-65535)
§Examples
use openmina::signaling_method::HttpSignalingInfo;
// Domain and port
let info: HttpSignalingInfo = "signal.example.com/443".parse()?;
// IPv4 and port
let info: HttpSignalingInfo = "192.168.1.100/8080".parse()?;
// With leading slash
let info: HttpSignalingInfo = "/localhost/8080".parse()?;
§Errors
Returns SignalingMethodParseError
for:
- Missing host or port components
- Invalid host format (not a valid hostname, IP, or multiaddr)
- Invalid port number (not a valid 16-bit unsigned integer)
Source§type Err = SignalingMethodParseError
type Err = SignalingMethodParseError
Source§impl Ord for HttpSignalingInfo
impl Ord for HttpSignalingInfo
Source§fn cmp(&self, other: &HttpSignalingInfo) -> Ordering
fn cmp(&self, other: &HttpSignalingInfo) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for HttpSignalingInfo
impl PartialEq for HttpSignalingInfo
Source§impl PartialOrd for HttpSignalingInfo
impl PartialOrd for HttpSignalingInfo
Source§impl Serialize for HttpSignalingInfo
impl Serialize for HttpSignalingInfo
impl Eq for HttpSignalingInfo
impl StructuralPartialEq for HttpSignalingInfo
Auto Trait Implementations§
impl Freeze for HttpSignalingInfo
impl RefUnwindSafe for HttpSignalingInfo
impl Send for HttpSignalingInfo
impl Sync for HttpSignalingInfo
impl Unpin for HttpSignalingInfo
impl UnwindSafe for HttpSignalingInfo
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<T> BinProtSize for Twhere
T: BinProtWrite,
impl<T> BinProtSize for Twhere
T: BinProtWrite,
fn binprot_size(&self) -> usize
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
Source§impl<T> FromBinProtStream for Twhere
T: BinProtRead,
impl<T> FromBinProtStream for Twhere
T: BinProtRead,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.