pub struct RequestContext { /* private fields */ }
Expand description
Context for retrieving request-related information and calling client features
Implementations§
Source§impl RequestContext
impl RequestContext
Sourcepub fn client_info(&self) -> &Implementation
pub fn client_info(&self) -> &Implementation
Gets client information
Sourcepub fn client_capabilities(&self) -> &ClientCapabilities
pub fn client_capabilities(&self) -> &ClientCapabilities
Gets client capabilities
Sourcepub fn protocol_version(&self) -> ProtocolVersion
pub fn protocol_version(&self) -> ProtocolVersion
Protocol version of the current session
Sourcepub fn progress(
&self,
progress: f64,
total: Option<f64>,
message: Option<String>,
)
pub fn progress( &self, progress: f64, total: Option<f64>, message: Option<String>, )
Notifies progress of the request associated with this context
Sourcepub async fn sampling_create_message(
&self,
p: CreateMessageRequestParams,
) -> SessionResult<CreateMessageResult>
pub async fn sampling_create_message( &self, p: CreateMessageRequestParams, ) -> SessionResult<CreateMessageResult>
Calls sampling/createMessage
Sourcepub async fn roots_list(&self) -> SessionResult<Vec<Root>>
pub async fn roots_list(&self) -> SessionResult<Vec<Root>>
Calls roots/list
Auto Trait Implementations§
impl Freeze for RequestContext
impl !RefUnwindSafe for RequestContext
impl Send for RequestContext
impl Sync for RequestContext
impl Unpin for RequestContext
impl !UnwindSafe for RequestContext
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