pub struct DeferredSigner { /* private fields */ }Expand description
Deferred event stream signer to allow a signer to be wired up later.
HTTP request signing takes place after serialization, and the event stream
message stream body is established during serialization. Since event stream
signing may need context from the initial HTTP signing operation, this
DeferredSigner is needed to wire up the signer later in the request lifecycle.
This signer basically just establishes a MPSC channel so that the sender can be placed in the request’s config. Then the HTTP signer implementation can retrieve the sender from that config and send an actual signing implementation with all the context needed.
When an event stream implementation needs to sign a message, the first call to sign will acquire a signing implementation off of the channel and cache it for the remainder of the operation.
Implementations§
Source§impl DeferredSigner
impl DeferredSigner
pub fn new() -> (Self, DeferredSignerSender)
Trait Implementations§
Source§impl Debug for DeferredSigner
impl Debug for DeferredSigner
Source§impl SignMessage for DeferredSigner
impl SignMessage for DeferredSigner
fn sign(&mut self, message: Message) -> Result<Message, SignMessageError>
Source§fn sign_empty(&mut self) -> Option<Result<Message, SignMessageError>>
fn sign_empty(&mut self) -> Option<Result<Message, SignMessageError>>
Some(_) to send a signed last empty message, before completing the stream.
Return None to not send one and terminate the stream immediately.Auto Trait Implementations§
impl !Freeze for DeferredSigner
impl !RefUnwindSafe for DeferredSigner
impl Send for DeferredSigner
impl Sync for DeferredSigner
impl Unpin for DeferredSigner
impl !UnwindSafe for DeferredSigner
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> 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