#[non_exhaustive]pub struct PluginRequestContext {
pub request_id: String,
pub user_id: Option<String>,
pub session_id: Option<String>,
pub client_id: Option<String>,
pub metadata: BTreeMap<String, Value>,
}Expand description
Curated request data passed to plugin tool calls.
Authentication internals and raw transport/session handles intentionally do not cross the plugin boundary.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.request_id: StringHost request identifier.
user_id: Option<String>Authenticated user identifier, when available.
session_id: Option<String>Stateful transport session identifier, when available.
client_id: Option<String>Client application identifier, when available.
metadata: BTreeMap<String, Value>Serializable request metadata copied by the host.
Implementations§
Source§impl PluginRequestContext
impl PluginRequestContext
Sourcepub fn with_user_id(self, user_id: Option<String>) -> Self
pub fn with_user_id(self, user_id: Option<String>) -> Self
Attach the authenticated user identifier.
Sourcepub fn with_session_id(self, session_id: Option<String>) -> Self
pub fn with_session_id(self, session_id: Option<String>) -> Self
Attach the transport session identifier.
Sourcepub fn with_client_id(self, client_id: Option<String>) -> Self
pub fn with_client_id(self, client_id: Option<String>) -> Self
Attach the client application identifier.
Sourcepub fn with_metadata(self, metadata: BTreeMap<String, Value>) -> Self
pub fn with_metadata(self, metadata: BTreeMap<String, Value>) -> Self
Attach copied request metadata.
Trait Implementations§
Source§impl Clone for PluginRequestContext
impl Clone for PluginRequestContext
Source§fn clone(&self) -> PluginRequestContext
fn clone(&self) -> PluginRequestContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PluginRequestContext
impl Debug for PluginRequestContext
Source§impl Default for PluginRequestContext
impl Default for PluginRequestContext
Source§fn default() -> PluginRequestContext
fn default() -> PluginRequestContext
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PluginRequestContext
impl<'de> Deserialize<'de> for PluginRequestContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PluginRequestContext
impl PartialEq for PluginRequestContext
Source§impl Serialize for PluginRequestContext
impl Serialize for PluginRequestContext
impl StructuralPartialEq for PluginRequestContext
Auto Trait Implementations§
impl Freeze for PluginRequestContext
impl RefUnwindSafe for PluginRequestContext
impl Send for PluginRequestContext
impl Sync for PluginRequestContext
impl Unpin for PluginRequestContext
impl UnsafeUnpin for PluginRequestContext
impl UnwindSafe for PluginRequestContext
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