pub enum MiddlewareMessage {
Register(MiddlewareRegistration),
Feedback(InterceptFeedback),
}
Expand description
The middleware can only send two types of messages to lnd: The initial registration message that identifies the middleware and after that only feedback messages to requests sent to the middleware.
Variants§
Register(MiddlewareRegistration)
The registration message identifies the middleware that’s being registered in lnd. The registration message must be sent immediately after initiating the RegisterRpcMiddleware stream, otherwise lnd will time out the attempt and terminate the request. NOTE: The middleware will only receive interception messages for requests that contain a macaroon with the custom caveat that the middleware declares it is responsible for handling in the registration message! As a security measure, no middleware can intercept requests made with unencumbered macaroons!
Feedback(InterceptFeedback)
The middleware received an interception request and gives feedback to it. The request_id indicates what message the feedback refers to.
Implementations§
source§impl MiddlewareMessage
impl MiddlewareMessage
pub fn encode<B>(&self, buf: &mut B)where
B: BufMut,
pub fn merge<B>(
field: &mut Option<MiddlewareMessage>,
tag: u32,
wire_type: WireType,
buf: &mut B,
ctx: DecodeContext
) -> Result<(), DecodeError>where
B: Buf,
pub fn encoded_len(&self) -> usize
Trait Implementations§
source§impl Clone for MiddlewareMessage
impl Clone for MiddlewareMessage
source§fn clone(&self) -> MiddlewareMessage
fn clone(&self) -> MiddlewareMessage
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MiddlewareMessage
impl Debug for MiddlewareMessage
source§impl PartialEq for MiddlewareMessage
impl PartialEq for MiddlewareMessage
source§fn eq(&self, other: &MiddlewareMessage) -> bool
fn eq(&self, other: &MiddlewareMessage) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for MiddlewareMessage
Auto Trait Implementations§
impl RefUnwindSafe for MiddlewareMessage
impl Send for MiddlewareMessage
impl Sync for MiddlewareMessage
impl Unpin for MiddlewareMessage
impl UnwindSafe for MiddlewareMessage
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request