pub struct PluginContext { /* private fields */ }Expand description
Borrowed capability boundary for one plugin invocation.
The type intentionally does not implement Clone: request and recorder
authority remain structurally tied to the invocation future.
Implementations§
Source§impl PluginContext
impl PluginContext
Exact authorized HTTP(S) origin.
Sourcepub const fn budget(&self) -> &PluginBudget
pub const fn budget(&self) -> &PluginBudget
Immutable resource budget.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns whether the host has cancelled this invocation.
Sourcepub fn record(&self, observation: PluginObservation) -> Result<(), PluginError>
pub fn record(&self, observation: PluginObservation) -> Result<(), PluginError>
Records one observation; host provenance and redaction are mandatory.
Sourcepub async fn request(
&self,
method: PluginHttpMethod,
url: Url,
) -> Result<PluginHttpResponse, PluginError>
pub async fn request( &self, method: PluginHttpMethod, url: Url, ) -> Result<PluginHttpResponse, PluginError>
Dispatches one bodyless request through the host-owned bounded broker.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PluginContext
impl !RefUnwindSafe for PluginContext
impl !UnwindSafe for PluginContext
impl Send for PluginContext
impl Sync for PluginContext
impl Unpin for PluginContext
impl UnsafeUnpin for PluginContext
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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