pub struct Budget { /* private fields */ }Implementations§
Trait Implementations§
Source§impl Extension for Budget
impl Extension for Budget
Source§fn on_request(
&self,
ctx: &RequestContext,
) -> BoxFuture<'_, Result<(), ExtensionError>>
fn on_request( &self, ctx: &RequestContext, ) -> BoxFuture<'_, Result<(), ExtensionError>>
Called post-auth, pre-dispatch. Return
Err to short-circuit the pipeline
(no provider call, no further extensions run).Source§fn on_response(
&self,
ctx: &RequestContext,
_raw_request: &[u8],
raw_response: &[u8],
) -> BoxFuture<'_, ()>
fn on_response( &self, ctx: &RequestContext, _raw_request: &[u8], raw_response: &[u8], ) -> BoxFuture<'_, ()>
Called after a non-streaming response arrives from the provider.
Both request and response are raw wire bytes.
Source§fn on_chunk(&self, ctx: &RequestContext, raw_chunk: &[u8]) -> BoxFuture<'_, ()>
fn on_chunk(&self, ctx: &RequestContext, raw_chunk: &[u8]) -> BoxFuture<'_, ()>
Called once per SSE chunk during a streaming response.
raw_chunk is the serialized JSON of the chunk.Source§fn storage_key(&self, suffix: &[u8]) -> Vec<u8> ⓘ
fn storage_key(&self, suffix: &[u8]) -> Vec<u8> ⓘ
Build a full storage key by prepending this extension’s prefix to
suffix.Auto Trait Implementations§
impl Freeze for Budget
impl !RefUnwindSafe for Budget
impl Send for Budget
impl Sync for Budget
impl Unpin for Budget
impl UnsafeUnpin for Budget
impl !UnwindSafe for Budget
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