Skip to main content

RequestParamsMeta

Trait RequestParamsMeta 

Source
pub trait RequestParamsMeta {
    // Required methods
    fn meta(&self) -> Option<&RequestMetaObject>;
    fn meta_mut(&mut self) -> &mut Option<RequestMetaObject>;

    // Provided methods
    fn set_meta(&mut self, meta: RequestMetaObject) { ... }
    fn progress_token(&self) -> Option<ProgressToken> { ... }
    fn set_progress_token(&mut self, token: ProgressToken) { ... }
    fn traceparent(&self) -> Option<&str> { ... }
    fn set_traceparent(&mut self, value: &str) { ... }
    fn tracestate(&self) -> Option<&str> { ... }
    fn set_tracestate(&mut self, value: &str) { ... }
    fn baggage(&self) -> Option<&str> { ... }
    fn set_baggage(&mut self, value: &str) { ... }
    fn meta_or_default(&mut self) -> &mut RequestMetaObject { ... }
}
Expand description

Trait for request params that contain the _meta field.

Per the MCP spec, all request params may have an optional _meta field (RequestMetaObject) that can contain a progressToken for tracking long-running operations.

Required Methods§

Source

fn meta(&self) -> Option<&RequestMetaObject>

Get a reference to the meta field

Source

fn meta_mut(&mut self) -> &mut Option<RequestMetaObject>

Get a mutable reference to the meta field

Provided Methods§

Source

fn set_meta(&mut self, meta: RequestMetaObject)

Set the meta field

Source

fn progress_token(&self) -> Option<ProgressToken>

Get the progress token from meta, if present

Source

fn set_progress_token(&mut self, token: ProgressToken)

Set a progress token in meta

Source

fn traceparent(&self) -> Option<&str>

Get the W3C traceparent value from meta, if present (SEP-414)

Source

fn set_traceparent(&mut self, value: &str)

Set the W3C traceparent value in meta (SEP-414)

Source

fn tracestate(&self) -> Option<&str>

Get the W3C tracestate value from meta, if present (SEP-414)

Source

fn set_tracestate(&mut self, value: &str)

Set the W3C tracestate value in meta (SEP-414)

Source

fn baggage(&self) -> Option<&str>

Get the W3C baggage value from meta, if present (SEP-414)

Source

fn set_baggage(&mut self, value: &str)

Set the W3C baggage value in meta (SEP-414)

Source

fn meta_or_default(&mut self) -> &mut RequestMetaObject

Get a mutable reference to meta, inserting an empty one if absent.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§