pub struct NoiseClientHandshake { /* private fields */ }Expand description
Single-use client handshake capability.
The responder static key, ephemeral secret, and handshake state never cross
the language boundary. Callers send Self::message_one over their native
WebSocket and consume the relay response through Self::complete.
Implementations§
Source§impl NoiseClientHandshake
impl NoiseClientHandshake
Sourcepub fn new(
relay_static_public_key: Vec<u8>,
request_chunking: bool,
) -> Result<Self, SoftchatError>
pub fn new( relay_static_public_key: Vec<u8>, request_chunking: bool, ) -> Result<Self, SoftchatError>
Start one Noise NK handshake for a known relay static public key.
§Errors
Returns a stable redacted error when the key is not exactly 32 bytes or the reviewed Softrelay implementation rejects the handshake.
Sourcepub fn message_one(&self) -> Vec<u8> ⓘ
pub fn message_one(&self) -> Vec<u8> ⓘ
Return the first handshake message to send as one binary WebSocket frame.
Sourcepub fn complete(
&self,
message_two: Vec<u8>,
) -> Result<Arc<NoiseTransport>, SoftchatError>
pub fn complete( &self, message_two: Vec<u8>, ) -> Result<Arc<NoiseTransport>, SoftchatError>
Consume the relay’s second handshake message and establish transport.
§Errors
Returns a stable redacted error for malformed/authentication failures or when this single-use capability was already consumed.
Trait Implementations§
Source§impl Debug for NoiseClientHandshake
impl Debug for NoiseClientHandshake
Source§impl<UT> LiftRef<UT> for NoiseClientHandshake
impl<UT> LiftRef<UT> for NoiseClientHandshake
type LiftType = Arc<NoiseClientHandshake>
Source§impl<UT> LowerError<UT> for NoiseClientHandshake
impl<UT> LowerError<UT> for NoiseClientHandshake
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Lower this value for scaffolding function return Read more
Source§impl<UT> LowerReturn<UT> for NoiseClientHandshake
impl<UT> LowerReturn<UT> for NoiseClientHandshake
Source§type ReturnType = <Arc<NoiseClientHandshake> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<NoiseClientHandshake> as LowerReturn<UniFfiTag>>::ReturnType
The type that should be returned by scaffolding functions for this type. Read more
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
Lower the return value from an scaffolding call Read more
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Lower the return value for failed argument lifts Read more
Source§impl<UT> TypeId<UT> for NoiseClientHandshake
impl<UT> TypeId<UT> for NoiseClientHandshake
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl !Freeze for NoiseClientHandshake
impl RefUnwindSafe for NoiseClientHandshake
impl Send for NoiseClientHandshake
impl Sync for NoiseClientHandshake
impl Unpin for NoiseClientHandshake
impl UnsafeUnpin for NoiseClientHandshake
impl UnwindSafe for NoiseClientHandshake
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Consume a handle, getting back the initial
Arc<> Read more