pub struct PeerRequest<P: PeerId> { /* private fields */ }Expand description
A peer’s request for a session, as a policy sees it.
Implementations§
Source§impl<P: PeerId> PeerRequest<P>
impl<P: PeerId> PeerRequest<P>
Sourcepub fn new(peer: P, request: SessionRequest, event: Event) -> Self
pub fn new(peer: P, request: SessionRequest, event: Event) -> Self
Creates a request of peer for a session it opened, as a node asks its policy.
Sourcepub fn with_direction(self, direction: Direction) -> Self
pub fn with_direction(self, direction: Direction) -> Self
Returns this request with direction saying which side opens the session.
For a session this node dials, the request is the one the node sends.
Sourcepub fn query(&self, key: &str) -> Option<&str>
pub fn query(&self, key: &str) -> Option<&str>
Returns a query parameter of the session’s request.
Sourcepub fn token(&self) -> Option<&str>
pub fn token(&self) -> Option<&str>
Returns the token the peer presented, as SessionRequest::token does.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for PeerRequest<P>where
P: Freeze,
impl<P> RefUnwindSafe for PeerRequest<P>where
P: RefUnwindSafe,
impl<P> Send for PeerRequest<P>
impl<P> Sync for PeerRequest<P>
impl<P> Unpin for PeerRequest<P>where
P: Unpin,
impl<P> UnsafeUnpin for PeerRequest<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for PeerRequest<P>where
P: UnwindSafe,
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