Enum ng_net::types::ProtocolMessage

source ·
pub enum ProtocolMessage {
Show 17 variants Probe([u8; 2]), ProbeResponse(ProbeResponse), Relay(RelayRequest), RelayResponse(RelayResponse), Tunnel(TunnelRequest), TunnelResponse(TunnelResponse), Noise(Noise), Start(StartProtocol), ServerHello(ServerHello), ClientAuth(ClientAuth), AuthResult(AuthResult), ExtRequest(ExtRequest), ExtResponse(ExtResponse), AdminResponse(AdminResponse), ClientMessage(ClientMessage), AppMessage(AppMessage), CoreMessage(CoreMessage),
}

Variants§

§

Probe([u8; 2])

§

ProbeResponse(ProbeResponse)

§

Relay(RelayRequest)

§

RelayResponse(RelayResponse)

§

Tunnel(TunnelRequest)

§

TunnelResponse(TunnelResponse)

§

Noise(Noise)

§

Start(StartProtocol)

§

ServerHello(ServerHello)

§

ClientAuth(ClientAuth)

§

AuthResult(AuthResult)

§

ExtRequest(ExtRequest)

§

ExtResponse(ExtResponse)

§

AdminResponse(AdminResponse)

§

ClientMessage(ClientMessage)

§

AppMessage(AppMessage)

§

CoreMessage(CoreMessage)

Implementations§

source§

impl ProtocolMessage

source

pub fn id(&self) -> Option<i64>

source

pub fn set_id(&mut self, id: i64)

source

pub fn type_id(&self) -> TypeId

source

pub fn get_actor(&self) -> Box<dyn EActor>

source

pub fn from_client_response_err(err: ServerError) -> ProtocolMessage

source

pub fn from_client_request_v0( req: ClientRequestContentV0, overlay: OverlayId ) -> ProtocolMessage

source

pub fn is_block(&self) -> bool

Trait Implementations§

source§

impl Clone for ProtocolMessage

source§

fn clone(&self) -> ProtocolMessage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ProtocolMessage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for ProtocolMessage

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<()> for ProtocolMessage

source§

fn from(_msg: ()) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<AddInvitation> for ProtocolMessage

source§

fn from(_msg: AddInvitation) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<AddUser> for ProtocolMessage

source§

fn from(_msg: AddUser) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<AdminRequest> for ProtocolMessage

source§

fn from(msg: AdminRequest) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<AdminResponse> for ProtocolMessage

source§

fn from(msg: AdminResponse) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<AdminResponseV0> for ProtocolMessage

source§

fn from(msg: AdminResponseV0) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<AppMessage> for ProtocolMessage

source§

fn from(msg: AppMessage) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<AppMessageContentV0> for ProtocolMessage

source§

fn from(content: AppMessageContentV0) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<AuthResult> for ProtocolMessage

source§

fn from(msg: AuthResult) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<Block> for ProtocolMessage

source§

fn from(b: Block) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<BlocksExist> for ProtocolMessage

source§

fn from(msg: BlocksExist) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<BlocksFound> for ProtocolMessage

source§

fn from(b: BlocksFound) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<BlocksGet> for ProtocolMessage

source§

fn from(msg: BlocksGet) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<BlocksPut> for ProtocolMessage

source§

fn from(msg: BlocksPut) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<ClientAuth> for ProtocolMessage

source§

fn from(msg: ClientAuth) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<ClientResponse> for ProtocolMessage

source§

fn from(msg: ClientResponse) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<ClientResponseContentV0> for ProtocolMessage

source§

fn from(msg: ClientResponseContentV0) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<CommitGet> for ProtocolMessage

source§

fn from(msg: CommitGet) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<CoreBrokerConnect> for ProtocolMessage

source§

fn from(_msg: CoreBrokerConnect) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<DelUser> for ProtocolMessage

source§

fn from(_msg: DelUser) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<ListInvitations> for ProtocolMessage

source§

fn from(_msg: ListInvitations) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<ListUsers> for ProtocolMessage

source§

fn from(_msg: ListUsers) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<PinRepo> for ProtocolMessage

source§

fn from(msg: PinRepo) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<PubKey> for ProtocolMessage

source§

fn from(_msg: UserId) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<PublishEvent> for ProtocolMessage

source§

fn from(msg: PublishEvent) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<RepoPinStatus> for ProtocolMessage

source§

fn from(res: RepoPinStatus) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<RepoPinStatusReq> for ProtocolMessage

source§

fn from(msg: RepoPinStatusReq) -> ProtocolMessage

Converts to this type from the input type.
source§

impl<A> From<Result<A, ServerError>> for ProtocolMessage

source§

fn from(res: Result<A, ServerError>) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<Result<EmptyAppResponse, ServerError>> for ProtocolMessage

source§

fn from(res: Result<EmptyAppResponse, ServerError>) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<TopicSub> for ProtocolMessage

source§

fn from(msg: TopicSub) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<TopicSubRes> for ProtocolMessage

source§

fn from(res: TopicSubRes) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<TopicSyncReq> for ProtocolMessage

source§

fn from(msg: TopicSyncReq) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<TopicSyncRes> for ProtocolMessage

source§

fn from(b: TopicSyncRes) -> ProtocolMessage

Converts to this type from the input type.
source§

impl From<Vec<TopicSubRes>> for ProtocolMessage

source§

fn from(res: RepoOpened) -> ProtocolMessage

Converts to this type from the input type.
source§

impl Serialize for ProtocolMessage

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl TryFrom<&ProtocolMessage> for ServerError

§

type Error = NgError

The type returned in the event of a conversion error.
source§

fn try_from(msg: &ProtocolMessage) -> Result<Self, NgError>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for ()

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(_msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for AddInvitation

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for AddUser

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for AdminResponse

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for AppMessageContentV0

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for Block

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for BlocksExist

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for BlocksFound

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for BlocksGet

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for BlocksPut

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for ClientRequestContentV0

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for ClientResponseContentV0

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for CommitGet

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for CoreBrokerConnectResponse

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for DelUser

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for EmptyAppResponse

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for ExtResponse

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for ListInvitations

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for ListUsers

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for PinRepo

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for ProbeResponse

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for UserId

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(_msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for PublishEvent

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for RepoPinStatus

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for RepoPinStatusReq

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for TopicSub

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for TopicSubRes

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for TopicSyncReq

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for TopicSyncRes

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ProtocolMessage> for RepoOpened

§

type Error = ProtocolError

The type returned in the event of a conversion error.
source§

fn try_from(msg: ProtocolMessage) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,