Struct Protocol
pub struct Protocol(/* private fields */);net only.Expand description
Web protocols that are relevant to Rama.
Please file an issue or open a PR if you need support for more protocols. When doing so please provide sufficient motivation and ensure it has no unintended consequences.
Implementations§
§impl Protocol
impl Protocol
pub const HTTP_SCHEME: &'static str = "http"
pub const HTTP_SCHEME: &'static str = "http"
HTTP protocol scheme
pub const HTTP_DEFAULT_PORT: u16 = 80u16
pub const HTTP_DEFAULT_PORT: u16 = 80u16
HTTP protocol default port
pub const HTTPS_SCHEME: &'static str = "https"
pub const HTTPS_SCHEME: &'static str = "https"
HTTPS protocol scheme
pub const HTTPS_DEFAULT_PORT: u16 = 443u16
pub const HTTPS_DEFAULT_PORT: u16 = 443u16
HTTPS protocol default port
pub const WS_DEFAULT_PORT: u16 = 80u16
pub const WS_DEFAULT_PORT: u16 = 80u16
WS protocol default port
pub const WSS_SCHEME: &'static str = "wss"
pub const WSS_SCHEME: &'static str = "wss"
WSS protocol scheme
pub const WSS_DEFAULT_PORT: u16 = 443u16
pub const WSS_DEFAULT_PORT: u16 = 443u16
WSS protocol default port
pub const SOCKS5_SCHEME: &'static str = "socks5"
pub const SOCKS5_SCHEME: &'static str = "socks5"
SOCKS5 protocol scheme
pub const SOCKS5_DEFAULT_PORT: u16 = 1_080u16
pub const SOCKS5_DEFAULT_PORT: u16 = 1_080u16
SOCKS5 protocol default port
pub const SOCKS5H_SCHEME: &'static str = "socks5h"
pub const SOCKS5H_SCHEME: &'static str = "socks5h"
SOCKS5H protocol scheme
pub const SOCKS5H_DEFAULT_PORT: u16 = 1_080u16
pub const SOCKS5H_DEFAULT_PORT: u16 = 1_080u16
SOCKS5H protocol default port
pub const fn from_static(s: &'static str) -> Protocol
pub const fn from_static(s: &'static str) -> Protocol
Creates a Protocol from a str a compile time.
This function requires the static string to be a valid protocol.
It is intended to be used to facilitate the compile-time creation of custom Protocols, as known protocols are easier created by using the desired variant directly.
§Panics
This function panics at compile time when the static string is not a valid protocol.
pub fn default_port(&self) -> Option<u16>
pub fn default_port(&self) -> Option<u16>
Returns the default port for this Protocol
Trait Implementations§
§impl From<ForwardedProtocol> for Protocol
impl From<ForwardedProtocol> for Protocol
§fn from(p: ForwardedProtocol) -> Protocol
fn from(p: ForwardedProtocol) -> Protocol
§impl Ord for Protocol
impl Ord for Protocol
§impl PartialOrd for Protocol
impl PartialOrd for Protocol
§impl TryFrom<&Protocol> for ForwardedProtocol
impl TryFrom<&Protocol> for ForwardedProtocol
§impl TryFrom<Protocol> for ForwardedProtocol
impl TryFrom<Protocol> for ForwardedProtocol
impl Eq for Protocol
impl StructuralPartialEq for Protocol
Auto Trait Implementations§
impl Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnwindSafe for Protocol
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> 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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> ⓘ
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
§impl<T> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.