#[non_exhaustive]pub struct DriverClass {
pub kind: DriverKind,
pub tools: &'static [ToolSpec],
}Expand description
A class of driver and its tools (spec 3.5 §7.13), as kernel driver manifests.
A driver is a kernel driver — a supervised MCP server under a manifest the owner
approved — or an in-process adapter with the same tools. A class’s manifest lists its
tools with their effect classes for one side; check_manifest
and check_listing tell whether any MCP server and its manifest
satisfy the class, so the owner may connect whichever server they choose (D-13).
§Example
use adk_drivers::{DriverKind, Side};
use adk_kernel::drivers::{DriverManifest, EffectClass};
let dns = DriverKind::Dns.class();
let text = dns.manifest_toml("dns", "mcp-dns", &[], Side::BackOffice);
let manifest = DriverManifest::from_toml(&text).unwrap();
assert_eq!(manifest.class_of("dns_change_records"), EffectClass::PublishPublic);
assert!(dns.check_manifest(&manifest, Side::BackOffice).is_satisfied());Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: DriverKindWhich class.
tools: &'static [ToolSpec]Its tools, on both sides.
Implementations§
Source§impl DriverClass
impl DriverClass
Sourcepub fn tools_for(
&self,
side: Side,
) -> impl Iterator<Item = &'static ToolSpec> + use<>
pub fn tools_for( &self, side: Side, ) -> impl Iterator<Item = &'static ToolSpec> + use<>
The tools that serve side.
Sourcepub fn manifest(
&self,
id: &str,
server: McpServerConfig,
side: Side,
) -> Result<DriverManifest, KernelError>
pub fn manifest( &self, id: &str, server: McpServerConfig, side: Side, ) -> Result<DriverManifest, KernelError>
The kernel manifest of driver id running server for side: the side’s tools with
their effect classes, serving the side’s partition.
§Errors
Returns KernelError::Config when id or the server is not a valid driver (see
DriverManifest::new), or the class has no tool on side.
Sourcepub fn manifest_toml(
&self,
id: &str,
command: &str,
args: &[&str],
side: Side,
) -> String
pub fn manifest_toml( &self, id: &str, command: &str, args: &[&str], side: Side, ) -> String
The TOML manifest of driver id running command with args for side, as the
owner reviews and mounts it (adk-rust drivers mount <file>).
Sourcepub fn check_manifest(
&self,
manifest: &DriverManifest,
side: Side,
) -> ManifestCheck
pub fn check_manifest( &self, manifest: &DriverManifest, side: Side, ) -> ManifestCheck
What keeps manifest from satisfying the class on side: a tool it does not list,
a tool it classes less strictly than the contract, a tool of the other side, or a
partition other than the side’s.
Sourcepub fn check_listing(
&self,
side: Side,
listed: &[(String, Value)],
) -> ManifestCheck
pub fn check_listing( &self, side: Side, listed: &[(String, Value)], ) -> ManifestCheck
What keeps an MCP server’s tool listing from satisfying the class on side: a tool
it does not offer, an argument the contract requires that its schema lacks, or a
tool beyond the side’s contract — which the kernel would serve to the partition as
other, so the server must not offer it there.
listed holds each tool’s name and input schema, as the server lists them.
Trait Implementations§
Source§impl Clone for DriverClass
impl Clone for DriverClass
impl Copy for DriverClass
Auto Trait Implementations§
impl Forget for DriverClass
impl Freeze for DriverClass
impl Move for DriverClass
impl RefUnwindSafe for DriverClass
impl Send for DriverClass
impl Sync for DriverClass
impl Unpin for DriverClass
impl UnsafeUnpin for DriverClasswhere
&'static [ToolSpec]: UnsafeUnpin,
impl UnwindSafe for DriverClasswhere
&'static [ToolSpec]: UnwindSafe,
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
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<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more