pub struct HandshakeCoordinator { /* private fields */ }
Expand description
Handshake coordinator
Implementations§
Source§impl HandshakeCoordinator
impl HandshakeCoordinator
Sourcepub fn new(
config: HandshakeConfig,
identity_keys: HandshakeKeys,
state_machine: ProtocolStateMachine,
) -> Self
pub fn new( config: HandshakeConfig, identity_keys: HandshakeKeys, state_machine: ProtocolStateMachine, ) -> Self
Create a new handshake coordinator
Sourcepub fn generate_keys() -> Result<HandshakeKeys, HandshakeError>
pub fn generate_keys() -> Result<HandshakeKeys, HandshakeError>
Generate new handshake keys
Sourcepub fn initiate_handshake(
&mut self,
peer_id: Option<Vec<u8>>,
) -> Result<(Uuid, Message), HandshakeError>
pub fn initiate_handshake( &mut self, peer_id: Option<Vec<u8>>, ) -> Result<(Uuid, Message), HandshakeError>
Initiate handshake with a peer
Sourcepub fn process_handshake_message(
&mut self,
message: &Message,
session_id: Option<Uuid>,
) -> Result<Option<Message>, HandshakeError>
pub fn process_handshake_message( &mut self, message: &Message, session_id: Option<Uuid>, ) -> Result<Option<Message>, HandshakeError>
Process incoming handshake message
Sourcepub fn get_session(&self, session_id: &Uuid) -> Option<&HandshakeSession>
pub fn get_session(&self, session_id: &Uuid) -> Option<&HandshakeSession>
Get handshake session
Sourcepub fn cleanup_sessions(&mut self)
pub fn cleanup_sessions(&mut self)
Remove completed or failed sessions
Sourcepub fn get_active_sessions(&self) -> Vec<&HandshakeSession>
pub fn get_active_sessions(&self) -> Vec<&HandshakeSession>
Get all active sessions
Sourcepub fn is_handshake_completed(&self, session_id: &Uuid) -> bool
pub fn is_handshake_completed(&self, session_id: &Uuid) -> bool
Check if handshake is completed for a session
Get shared secrets for a completed session
Auto Trait Implementations§
impl Freeze for HandshakeCoordinator
impl RefUnwindSafe for HandshakeCoordinator
impl Send for HandshakeCoordinator
impl Sync for HandshakeCoordinator
impl Unpin for HandshakeCoordinator
impl UnwindSafe for HandshakeCoordinator
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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