pub struct PeerCtx {
pub peer_id: String,
pub node_verified: bool,
pub class: PeerClass,
pub remote_static: Option<Vec<u8>>,
pub src_scope: Option<Scope>,
}Expand description
Who delivered a message, as established by the connection.
Fields§
§peer_id: StringThe peer’s node id. When node_verified
this is the id admission verified; otherwise it is merely what the
peer claimed in source_node.
node_verified: boolTrue when admission verified peer_id (signed hello bound to the
Noise session). False for legacy/plaintext peers and in off mode.
class: PeerClassClass admission assigned.
remote_static: Option<Vec<u8>>The peer’s Noise static public key, when the channel had one.
src_scope: Option<Scope>The envelope’s src_scope claim. Already stripped by the listener
unless the peer is verified; still unproven until the receiver
checks a certificate chain.
Implementations§
Source§impl PeerCtx
impl PeerCtx
Sourcepub fn grant(&self) -> Option<Grant>
pub fn grant(&self) -> Option<Grant>
The admission grant this connection holds, rebuilt from what the
connection recorded (node_verified is Grant::admitted: the hello
verified, the gate enforced and admitted; class is the class
admission assigned). trust_scope follows the rule every gate applies,
admitted Node peers only. A connection that is not admitted holds
no grant.
Sourcepub fn unauthenticated(peer_id: impl Into<String>) -> Self
pub fn unauthenticated(peer_id: impl Into<String>) -> Self
A peer with no authenticated identity (embedded use, tests, off
mode): peer_id is only the claimed source node.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeerCtx
impl RefUnwindSafe for PeerCtx
impl Send for PeerCtx
impl Sync for PeerCtx
impl Unpin for PeerCtx
impl UnsafeUnpin for PeerCtx
impl UnwindSafe for PeerCtx
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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