pub enum Protocol {
Http,
WebSocket,
GraphQL,
Grpc,
Smtp,
Mqtt,
Kafka,
Amqp,
Tcp,
}Expand description
Protocols that can be enabled on a hosted mock deployment.
Tracks two things at once: what protocol crate the deployed
mockforge-cli will serve, and how Fly.io should expose it. Some
protocols ride on the HTTP port (WS upgrade / GraphQL POST) so the Fly
service config doesn’t change; others need their own TCP service entry
and may need TLS handlers.
Plan gating in Protocol::min_plan keeps Free deployments to HTTP-only,
Pro adds gRPC, and Team unlocks the full broker set.
Variants§
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub fn internal_port(self) -> Option<u16>
pub fn internal_port(self) -> Option<u16>
Internal port the protocol binds inside the container.
None for protocols that share the HTTP listener (handled by the
in-process router merge done in mockforge-cli’s serve command).
Sourcepub fn public_port(self) -> Option<u16>
pub fn public_port(self) -> Option<u16>
Public port to expose on Fly. Same as internal_port by default;
SMTP runs on 2525 publicly because many ISPs block outbound 25.
Sourcepub fn fly_handlers(self) -> &'static [&'static str]
pub fn fly_handlers(self) -> &'static [&'static str]
Fly TLS handlers to attach. ["tls"] for binary protocols that
terminate TLS at Fly’s edge; [] for plain TCP; ["h2"] for gRPC.
Sourcepub fn enable_env(self) -> Option<(&'static str, String)>
pub fn enable_env(self) -> Option<(&'static str, String)>
Env var pair set on the Fly machine to enable this protocol in the
mockforge-cli serve runtime. None for protocols that are always
on (HTTP) or merged into HTTP (WS/GraphQL).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Protocol
impl<'de> Deserialize<'de> for Protocol
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Protocol, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Protocol, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Protocol
impl Serialize for Protocol
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for Protocol
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 UnsafeUnpin for Protocol
impl UnwindSafe for Protocol
Blanket Implementations§
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
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more