Skip to main content

Server

Struct Server 

Source
pub struct Server { /* private fields */ }
Expand description

Protocol service composed with one coherent engine runtime.

Implementations§

Source§

impl Server

Source

pub fn router(self: Arc<Self>, token: Arc<Zeroizing<String>>) -> Router

Source

pub async fn serve( self: Arc<Self>, port: u16, token: Zeroizing<String>, ) -> Result<RunningServer, ServerError>

Source§

impl Server

Source

pub fn new(engine: Engine) -> Self

Source

pub fn shutdown(&self)

Source

pub async fn serve_stream<S>( self: Arc<Self>, stream: S, ) -> Result<(), TransportError>
where S: MessageStream,

Trait Implementations§

Source§

impl Clone for Server

Source§

fn clone(&self) -> Server

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ServerProtocol for Server

Source§

fn connected<'life0, 'async_trait>( &'life0 self, context: ServerContext, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Called after the exact-version handshake response has been sent.
Source§

fn create_session<'life0, 'async_trait>( &'life0 self, params: SessionCreateParams, ) -> Pin<Box<dyn Future<Output = Result<SessionCreateResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_sessions<'life0, 'async_trait>( &'life0 self, params: SessionListParams, ) -> Pin<Box<dyn Future<Output = Result<SessionListResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_session<'life0, 'async_trait>( &'life0 self, params: SessionGetParams, ) -> Pin<Box<dyn Future<Output = Result<SessionGetResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_session_goal<'life0, 'async_trait>( &'life0 self, params: SessionGoalGetParams, ) -> Pin<Box<dyn Future<Output = Result<SessionGoalGetResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the root session’s current goal, if any. Read more
Source§

fn set_session_goal<'life0, 'async_trait>( &'life0 self, params: SessionGoalSetParams, ) -> Pin<Box<dyn Future<Output = Result<SessionGoalSetResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Activates a user-owned goal on a root session. Read more
Source§

fn change_session_goal_lifecycle<'life0, 'async_trait>( &'life0 self, params: SessionGoalLifecycleParams, ) -> Pin<Box<dyn Future<Output = Result<SessionGoalLifecycleResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Applies a user-owned lifecycle transition to a root session goal. Read more
Source§

fn session_producers<'life0, 'async_trait>( &'life0 self, params: SessionProducersParams, ) -> Pin<Box<dyn Future<Output = Result<SessionProducersResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the runtime-only producer registry for the requested session.
Source§

fn session_usage<'life0, 'async_trait>( &'life0 self, params: SessionUsageParams, ) -> Pin<Box<dyn Future<Output = Result<SessionUsageResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn session_tree_usage<'life0, 'async_trait>( &'life0 self, params: SessionUsageParams, ) -> Pin<Box<dyn Future<Output = Result<SessionTreeUsageResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn agent_usage<'life0, 'async_trait>( &'life0 self, params: AgentUsageParams, ) -> Pin<Box<dyn Future<Output = Result<AgentUsageResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn global_usage<'life0, 'async_trait>( &'life0 self, __arg1: GlobalUsageParams, ) -> Pin<Box<dyn Future<Output = Result<GlobalUsageResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn session_children<'life0, 'async_trait>( &'life0 self, params: SessionChildrenParams, ) -> Pin<Box<dyn Future<Output = Result<SessionChildrenResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn session_tree<'life0, 'async_trait>( &'life0 self, params: SessionTreeParams, ) -> Pin<Box<dyn Future<Output = Result<SessionTreeResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn resume_session<'life0, 'async_trait>( &'life0 self, params: SessionResumeParams, ) -> Pin<Box<dyn Future<Output = Result<SessionResumeResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn rename_session<'life0, 'async_trait>( &'life0 self, params: SessionRenameParams, ) -> Pin<Box<dyn Future<Output = Result<SessionRenameResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn set_permission_mode<'life0, 'async_trait>( &'life0 self, params: SessionSetPermissionModeParams, ) -> Pin<Box<dyn Future<Output = Result<SessionSetPermissionModeResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_session_permissions<'life0, 'async_trait>( &'life0 self, params: SessionPermissionGetParams, ) -> Pin<Box<dyn Future<Output = Result<SessionPermissionGetResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn set_session_permission<'life0, 'async_trait>( &'life0 self, params: SessionPermissionSetParams, ) -> Pin<Box<dyn Future<Output = Result<SessionPermissionMutationResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn clear_session_permission<'life0, 'async_trait>( &'life0 self, params: SessionPermissionClearParams, ) -> Pin<Box<dyn Future<Output = Result<SessionPermissionMutationResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_skills<'life0, 'async_trait>( &'life0 self, params: SkillsListParams, ) -> Pin<Box<dyn Future<Output = Result<SkillsListResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_skill<'life0, 'async_trait>( &'life0 self, params: SkillsGetParams, ) -> Pin<Box<dyn Future<Output = Result<SkillsGetResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn compact_session<'life0, 'async_trait>( &'life0 self, params: SessionCompactParams, ) -> Pin<Box<dyn Future<Output = Result<SessionCompactResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn revert_session<'life0, 'async_trait>( &'life0 self, params: SessionRevertParams, ) -> Pin<Box<dyn Future<Output = Result<SessionRevertResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn fork_session<'life0, 'async_trait>( &'life0 self, params: SessionForkParams, ) -> Pin<Box<dyn Future<Output = Result<SessionForkResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn start_run<'life0, 'async_trait>( &'life0 self, params: RunStartParams, ) -> Pin<Box<dyn Future<Output = Result<RunStartResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn steer_run<'life0, 'async_trait>( &'life0 self, params: RunSteerParams, ) -> Pin<Box<dyn Future<Output = Result<RunSteerResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn recall_steer<'life0, 'async_trait>( &'life0 self, params: RunRecallSteerParams, ) -> Pin<Box<dyn Future<Output = Result<RunRecallSteerResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn cancel_run<'life0, 'async_trait>( &'life0 self, params: RunCancelParams, ) -> Pin<Box<dyn Future<Output = Result<RunCancelResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn tool_stdin<'life0, 'async_trait>( &'life0 self, params: RunToolStdinParams, ) -> Pin<Box<dyn Future<Output = Result<RunToolStdinResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn subscribe_events<'life0, 'life1, 'async_trait>( &'life0 self, params: EventsSubscribeParams, context: &'life1 ServerContext, ) -> Pin<Box<dyn Future<Output = Result<EventsSubscribeResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn respond_approval<'life0, 'async_trait>( &'life0 self, params: ApprovalRespondParams, ) -> Pin<Box<dyn Future<Output = Result<ApprovalRespondResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_approvals<'life0, 'async_trait>( &'life0 self, params: ApprovalListParams, ) -> Pin<Box<dyn Future<Output = Result<ApprovalListResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn begin_mcp_auth<'life0, 'async_trait>( &'life0 self, params: McpAuthBeginParams, ) -> Pin<Box<dyn Future<Output = Result<McpAuthBeginResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn cancel_mcp_auth<'life0, 'async_trait>( &'life0 self, params: McpAuthCancelParams, ) -> Pin<Box<dyn Future<Output = Result<McpAuthCancelResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn list_mcp_servers<'life0, 'async_trait>( &'life0 self, __arg1: McpServerListParams, ) -> Pin<Box<dyn Future<Output = Result<McpServerListResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn add_mcp_server<'life0, 'async_trait>( &'life0 self, params: McpServerAddParams, ) -> Pin<Box<dyn Future<Output = Result<McpServerMutationResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn edit_mcp_server<'life0, 'async_trait>( &'life0 self, params: McpServerEditParams, ) -> Pin<Box<dyn Future<Output = Result<McpServerMutationResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn remove_mcp_server<'life0, 'async_trait>( &'life0 self, params: McpServerNameParams, ) -> Pin<Box<dyn Future<Output = Result<McpServerMutationResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn set_mcp_server_enabled<'life0, 'async_trait>( &'life0 self, params: McpServerSetEnabledParams, ) -> Pin<Box<dyn Future<Output = Result<McpServerMutationResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn reconnect_mcp_server<'life0, 'async_trait>( &'life0 self, params: McpServerNameParams, ) -> Pin<Box<dyn Future<Output = Result<McpServerMutationResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn persist_mcp_server<'life0, 'async_trait>( &'life0 self, params: McpServerPersistParams, ) -> Pin<Box<dyn Future<Output = Result<McpServerMutationResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn runtime_snapshot<'life0, 'async_trait>( &'life0 self, __arg1: RuntimeSnapshotGetParams, ) -> Pin<Box<dyn Future<Output = Result<RuntimeSnapshotResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn connect_provider<'life0, 'async_trait>( &'life0 self, params: ProviderConnectParams, ) -> Pin<Box<dyn Future<Output = Result<ProviderConnectResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn disconnect_provider<'life0, 'async_trait>( &'life0 self, params: ProviderDisconnectParams, ) -> Pin<Box<dyn Future<Output = Result<ProviderDisconnectResult, ServerFault>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more