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
impl ProtocolMessage
pub fn id(&self) -> Option<i64>
pub fn set_id(&mut self, id: i64)
pub fn type_id(&self) -> TypeId
pub fn get_actor(&self) -> Box<dyn EActor>
pub fn from_client_response_err(err: ServerError) -> ProtocolMessage
pub fn from_client_request_v0( req: ClientRequestContentV0, overlay: OverlayId ) -> ProtocolMessage
pub fn is_block(&self) -> bool
Trait Implementations§
source§impl Clone for ProtocolMessage
impl Clone for ProtocolMessage
source§fn clone(&self) -> ProtocolMessage
fn clone(&self) -> ProtocolMessage
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ProtocolMessage
impl Debug for ProtocolMessage
source§impl<'de> Deserialize<'de> for ProtocolMessage
impl<'de> Deserialize<'de> for ProtocolMessage
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<()> for ProtocolMessage
impl From<()> for ProtocolMessage
source§fn from(_msg: ()) -> ProtocolMessage
fn from(_msg: ()) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<AddInvitation> for ProtocolMessage
impl From<AddInvitation> for ProtocolMessage
source§fn from(_msg: AddInvitation) -> ProtocolMessage
fn from(_msg: AddInvitation) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<AddUser> for ProtocolMessage
impl From<AddUser> for ProtocolMessage
source§fn from(_msg: AddUser) -> ProtocolMessage
fn from(_msg: AddUser) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<AdminRequest> for ProtocolMessage
impl From<AdminRequest> for ProtocolMessage
source§fn from(msg: AdminRequest) -> ProtocolMessage
fn from(msg: AdminRequest) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<AdminResponse> for ProtocolMessage
impl From<AdminResponse> for ProtocolMessage
source§fn from(msg: AdminResponse) -> ProtocolMessage
fn from(msg: AdminResponse) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<AdminResponseV0> for ProtocolMessage
impl From<AdminResponseV0> for ProtocolMessage
source§fn from(msg: AdminResponseV0) -> ProtocolMessage
fn from(msg: AdminResponseV0) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<AppMessage> for ProtocolMessage
impl From<AppMessage> for ProtocolMessage
source§fn from(msg: AppMessage) -> ProtocolMessage
fn from(msg: AppMessage) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<AppMessageContentV0> for ProtocolMessage
impl From<AppMessageContentV0> for ProtocolMessage
source§fn from(content: AppMessageContentV0) -> ProtocolMessage
fn from(content: AppMessageContentV0) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<AuthResult> for ProtocolMessage
impl From<AuthResult> for ProtocolMessage
source§fn from(msg: AuthResult) -> ProtocolMessage
fn from(msg: AuthResult) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<Block> for ProtocolMessage
impl From<Block> for ProtocolMessage
source§fn from(b: Block) -> ProtocolMessage
fn from(b: Block) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<BlocksExist> for ProtocolMessage
impl From<BlocksExist> for ProtocolMessage
source§fn from(msg: BlocksExist) -> ProtocolMessage
fn from(msg: BlocksExist) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<BlocksFound> for ProtocolMessage
impl From<BlocksFound> for ProtocolMessage
source§fn from(b: BlocksFound) -> ProtocolMessage
fn from(b: BlocksFound) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<BlocksGet> for ProtocolMessage
impl From<BlocksGet> for ProtocolMessage
source§fn from(msg: BlocksGet) -> ProtocolMessage
fn from(msg: BlocksGet) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<BlocksPut> for ProtocolMessage
impl From<BlocksPut> for ProtocolMessage
source§fn from(msg: BlocksPut) -> ProtocolMessage
fn from(msg: BlocksPut) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<ClientAuth> for ProtocolMessage
impl From<ClientAuth> for ProtocolMessage
source§fn from(msg: ClientAuth) -> ProtocolMessage
fn from(msg: ClientAuth) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<ClientResponse> for ProtocolMessage
impl From<ClientResponse> for ProtocolMessage
source§fn from(msg: ClientResponse) -> ProtocolMessage
fn from(msg: ClientResponse) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<ClientResponseContentV0> for ProtocolMessage
impl From<ClientResponseContentV0> for ProtocolMessage
source§fn from(msg: ClientResponseContentV0) -> ProtocolMessage
fn from(msg: ClientResponseContentV0) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<CommitGet> for ProtocolMessage
impl From<CommitGet> for ProtocolMessage
source§fn from(msg: CommitGet) -> ProtocolMessage
fn from(msg: CommitGet) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<CoreBrokerConnect> for ProtocolMessage
impl From<CoreBrokerConnect> for ProtocolMessage
source§fn from(_msg: CoreBrokerConnect) -> ProtocolMessage
fn from(_msg: CoreBrokerConnect) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<DelUser> for ProtocolMessage
impl From<DelUser> for ProtocolMessage
source§fn from(_msg: DelUser) -> ProtocolMessage
fn from(_msg: DelUser) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<ListInvitations> for ProtocolMessage
impl From<ListInvitations> for ProtocolMessage
source§fn from(_msg: ListInvitations) -> ProtocolMessage
fn from(_msg: ListInvitations) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<ListUsers> for ProtocolMessage
impl From<ListUsers> for ProtocolMessage
source§fn from(_msg: ListUsers) -> ProtocolMessage
fn from(_msg: ListUsers) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<PinRepo> for ProtocolMessage
impl From<PinRepo> for ProtocolMessage
source§fn from(msg: PinRepo) -> ProtocolMessage
fn from(msg: PinRepo) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<PubKey> for ProtocolMessage
impl From<PubKey> for ProtocolMessage
source§fn from(_msg: UserId) -> ProtocolMessage
fn from(_msg: UserId) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<PublishEvent> for ProtocolMessage
impl From<PublishEvent> for ProtocolMessage
source§fn from(msg: PublishEvent) -> ProtocolMessage
fn from(msg: PublishEvent) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<RepoPinStatus> for ProtocolMessage
impl From<RepoPinStatus> for ProtocolMessage
source§fn from(res: RepoPinStatus) -> ProtocolMessage
fn from(res: RepoPinStatus) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<RepoPinStatusReq> for ProtocolMessage
impl From<RepoPinStatusReq> for ProtocolMessage
source§fn from(msg: RepoPinStatusReq) -> ProtocolMessage
fn from(msg: RepoPinStatusReq) -> ProtocolMessage
Converts to this type from the input type.
source§impl<A> From<Result<A, ServerError>> for ProtocolMessage
impl<A> From<Result<A, ServerError>> for ProtocolMessage
source§fn from(res: Result<A, ServerError>) -> ProtocolMessage
fn from(res: Result<A, ServerError>) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<Result<EmptyAppResponse, ServerError>> for ProtocolMessage
impl From<Result<EmptyAppResponse, ServerError>> for ProtocolMessage
source§fn from(res: Result<EmptyAppResponse, ServerError>) -> ProtocolMessage
fn from(res: Result<EmptyAppResponse, ServerError>) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<TopicSub> for ProtocolMessage
impl From<TopicSub> for ProtocolMessage
source§fn from(msg: TopicSub) -> ProtocolMessage
fn from(msg: TopicSub) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<TopicSubRes> for ProtocolMessage
impl From<TopicSubRes> for ProtocolMessage
source§fn from(res: TopicSubRes) -> ProtocolMessage
fn from(res: TopicSubRes) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<TopicSyncReq> for ProtocolMessage
impl From<TopicSyncReq> for ProtocolMessage
source§fn from(msg: TopicSyncReq) -> ProtocolMessage
fn from(msg: TopicSyncReq) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<TopicSyncRes> for ProtocolMessage
impl From<TopicSyncRes> for ProtocolMessage
source§fn from(b: TopicSyncRes) -> ProtocolMessage
fn from(b: TopicSyncRes) -> ProtocolMessage
Converts to this type from the input type.
source§impl From<Vec<TopicSubRes>> for ProtocolMessage
impl From<Vec<TopicSubRes>> for ProtocolMessage
source§fn from(res: RepoOpened) -> ProtocolMessage
fn from(res: RepoOpened) -> ProtocolMessage
Converts to this type from the input type.
source§impl Serialize for ProtocolMessage
impl Serialize for ProtocolMessage
source§impl TryFrom<&ProtocolMessage> for ServerError
impl TryFrom<&ProtocolMessage> for ServerError
source§impl TryFrom<ProtocolMessage> for ()
impl TryFrom<ProtocolMessage> for ()
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for AddInvitation
impl TryFrom<ProtocolMessage> for AddInvitation
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for AddUser
impl TryFrom<ProtocolMessage> for AddUser
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for AdminResponse
impl TryFrom<ProtocolMessage> for AdminResponse
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for AppMessageContentV0
impl TryFrom<ProtocolMessage> for AppMessageContentV0
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for Block
impl TryFrom<ProtocolMessage> for Block
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for BlocksExist
impl TryFrom<ProtocolMessage> for BlocksExist
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for BlocksFound
impl TryFrom<ProtocolMessage> for BlocksFound
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for BlocksGet
impl TryFrom<ProtocolMessage> for BlocksGet
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for BlocksPut
impl TryFrom<ProtocolMessage> for BlocksPut
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for ClientRequestContentV0
impl TryFrom<ProtocolMessage> for ClientRequestContentV0
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for ClientResponseContentV0
impl TryFrom<ProtocolMessage> for ClientResponseContentV0
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for CommitGet
impl TryFrom<ProtocolMessage> for CommitGet
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for CoreBrokerConnectResponse
impl TryFrom<ProtocolMessage> for CoreBrokerConnectResponse
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for DelUser
impl TryFrom<ProtocolMessage> for DelUser
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for EmptyAppResponse
impl TryFrom<ProtocolMessage> for EmptyAppResponse
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for ExtResponse
impl TryFrom<ProtocolMessage> for ExtResponse
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for ListInvitations
impl TryFrom<ProtocolMessage> for ListInvitations
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for ListUsers
impl TryFrom<ProtocolMessage> for ListUsers
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for PinRepo
impl TryFrom<ProtocolMessage> for PinRepo
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for ProbeResponse
impl TryFrom<ProtocolMessage> for ProbeResponse
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for UserId
impl TryFrom<ProtocolMessage> for UserId
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for PublishEvent
impl TryFrom<ProtocolMessage> for PublishEvent
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for RepoPinStatus
impl TryFrom<ProtocolMessage> for RepoPinStatus
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for RepoPinStatusReq
impl TryFrom<ProtocolMessage> for RepoPinStatusReq
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for TopicSub
impl TryFrom<ProtocolMessage> for TopicSub
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for TopicSubRes
impl TryFrom<ProtocolMessage> for TopicSubRes
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for TopicSyncReq
impl TryFrom<ProtocolMessage> for TopicSyncReq
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for TopicSyncRes
impl TryFrom<ProtocolMessage> for TopicSyncRes
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
source§impl TryFrom<ProtocolMessage> for RepoOpened
impl TryFrom<ProtocolMessage> for RepoOpened
§type Error = ProtocolError
type Error = ProtocolError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ProtocolMessage
impl RefUnwindSafe for ProtocolMessage
impl Send for ProtocolMessage
impl Sync for ProtocolMessage
impl Unpin for ProtocolMessage
impl UnwindSafe for ProtocolMessage
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
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>
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 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>
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