pub enum ProtocolId {
Show 13 variants
Http,
Socks4,
Socks5,
Shadowsocks,
ShadowsocksR,
Trojan,
Http2,
Http3,
Quic,
WebSocket,
Raw,
Echo,
Reverse,
}Expand description
A unique identifier for a protocol handler.
Variants§
Implementations§
Source§impl ProtocolId
impl ProtocolId
Sourcepub fn from_protocol_spec(
spec: ProtocolSpec,
) -> Result<Self, ProtocolConversionError>
pub fn from_protocol_spec( spec: ProtocolSpec, ) -> Result<Self, ProtocolConversionError>
Central typed conversion from URI syntax to runtime disposition.
Exhaustive over eggress_uri::ProtocolSpec; unsupported and
non-dispatchable variants fail explicitly instead of silent fallback:
HttpOnlyis an upstream request adapter; listeners serveHttp.Unixis a transport concept; listeners serve it asRawTCP semantics with a unix-socket bind (seeListenerUdpConfig/unix listener).Sshis upstream-only and returnsProtocolConversionError::UpstreamOnlyTransport.Echo/Reverseare runtime-only: they have noProtocolSpeccounterpart and never flow through this conversion.Rawcovers bothrawandtunnelURI aliases (canonicalized inProtocolSpec), andWebSocketcoversws/wss.H3/Quicmap directly; feature gating (optionalquicbuild) stays in config compilation, not here.
Trait Implementations§
Source§impl Clone for ProtocolId
impl Clone for ProtocolId
Source§fn clone(&self) -> ProtocolId
fn clone(&self) -> ProtocolId
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ProtocolId
Source§impl Debug for ProtocolId
impl Debug for ProtocolId
Source§impl Display for ProtocolId
impl Display for ProtocolId
impl Eq for ProtocolId
Source§impl Hash for ProtocolId
impl Hash for ProtocolId
Source§impl PartialEq for ProtocolId
impl PartialEq for ProtocolId
impl StructuralPartialEq for ProtocolId
Auto Trait Implementations§
impl Freeze for ProtocolId
impl RefUnwindSafe for ProtocolId
impl Send for ProtocolId
impl Sync for ProtocolId
impl Unpin for ProtocolId
impl UnsafeUnpin for ProtocolId
impl UnwindSafe for ProtocolId
Blanket Implementations§
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
Mutably borrows from an owned value. Read more