pub enum Transport {
GiftWrap,
Nip44Direct,
}Expand description
The wire transport a node speaks. A node runs exactly one: the
operator picks protocol v1 or v2 via the transport setting
("gift-wrap" or "nip44"), and every message — inbound subscription
and outbound replies — uses that transport.
Variants§
GiftWrap
protocol v1 (gift-wrap) is being phased out — mostrod v0.19.0 runs protocol v2 (nip44) only; see https://github.com/MostroP2P/mostro/issues/786
Protocol v1 — NIP-59 GiftWrap (kind: 1059).
DEPRECATED(mostro#786): protocol v1 is being phased out. mostrod
v0.19.0 removes its transport setting and runs protocol v2
(nip44) only; this variant will be removed from mostro-core in a
following release, once the ecosystem completes the v2 migration.
Clients may still need it meanwhile to talk to pre-v2 nodes.
Nip44Direct
Protocol v2 — NIP-44 direct message (kind: 14).
Implementations§
Source§impl Transport
impl Transport
Sourcepub fn event_kind(&self) -> Kind
pub fn event_kind(&self) -> Kind
The Nostr event kind this transport publishes and subscribes to.
Sourcepub fn protocol_version(&self) -> u8
pub fn protocol_version(&self) -> u8
The Mostro protocol version this transport carries, for capability
advertisement (the protocol_versions tag of the node info event).
Trait Implementations§
impl Copy for Transport
Source§impl Default for Transport
Manual impl (not #[derive(Default)] + #[default]) because the default
variant is the deprecated one and the derive would trip the deprecation
lint at the definition site. The default stays GiftWrap for backward
compatibility until mostrod v0.19.0 flips the ecosystem to v2 only.
impl Default for Transport
Manual impl (not #[derive(Default)] + #[default]) because the default
variant is the deprecated one and the derive would trip the deprecation
lint at the definition site. The default stays GiftWrap for backward
compatibility until mostrod v0.19.0 flips the ecosystem to v2 only.
Source§impl<'de> Deserialize<'de> for Transport
impl<'de> Deserialize<'de> for Transport
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>,
impl Eq for Transport
impl StructuralPartialEq for Transport
Auto Trait Implementations§
impl Freeze for Transport
impl RefUnwindSafe for Transport
impl Send for Transport
impl Sync for Transport
impl Unpin for Transport
impl UnsafeUnpin for Transport
impl UnwindSafe for Transport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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