pub struct ProtocolSupport { /* private fields */ }Expand description
Exact, ordered protocol-version allow-list for one runtime component.
ProtocolSupport::default enables every version compiled into the crate.
Use ProtocolSupport::try_new to narrow an individual server or client.
The order is preserved and is used as the advertised preference order.
use tower_mcp::ProtocolSupport;
let support = ProtocolSupport::try_new(["2025-11-25"])?;
assert!(support.contains("2025-11-25"));
assert!(!support.contains("2025-03-26"));Implementations§
Source§impl ProtocolSupport
impl ProtocolSupport
Sourcepub fn stable() -> Self
pub fn stable() -> Self
Enable only the stable-by-default compatibility set.
This excludes opt-in protocol implementations even when their Cargo features are compiled.
Sourcepub fn try_new<I, S>(versions: I) -> Result<Self, ProtocolSupportError>
pub fn try_new<I, S>(versions: I) -> Result<Self, ProtocolSupportError>
Construct an exact runtime allow-list.
Versions must be compiled into the crate, must not be duplicated, and the list must not be empty.
Trait Implementations§
Source§impl Clone for ProtocolSupport
impl Clone for ProtocolSupport
Source§fn clone(&self) -> ProtocolSupport
fn clone(&self) -> ProtocolSupport
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 ProtocolSupport
impl Debug for ProtocolSupport
Source§impl Default for ProtocolSupport
impl Default for ProtocolSupport
impl Eq for ProtocolSupport
Source§impl PartialEq for ProtocolSupport
impl PartialEq for ProtocolSupport
impl StructuralPartialEq for ProtocolSupport
Auto Trait Implementations§
impl Freeze for ProtocolSupport
impl RefUnwindSafe for ProtocolSupport
impl Send for ProtocolSupport
impl Sync for ProtocolSupport
impl Unpin for ProtocolSupport
impl UnsafeUnpin for ProtocolSupport
impl UnwindSafe for ProtocolSupport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.