pub struct SomaService { /* private fields */ }Expand description
The service layer — wraps the transport client and adds business logic.
Customize: rename this to MyServiceService (or whatever fits).
Add any fields you need: caches, config, metrics, etc.
Implementations§
Source§impl SomaService
impl SomaService
Sourcepub async fn greet(&self, name: Option<&str>) -> Result<Value>
pub async fn greet(&self, name: Option<&str>) -> Result<Value>
Return a greeting for name, defaulting to “World”.
Sourcepub async fn call_rest_action(
&self,
action: &str,
params: Value,
) -> Result<Value>
pub async fn call_rest_action( &self, action: &str, params: Value, ) -> Result<Value>
Call one direct REST action on a remote Soma HTTP server.
Sourcepub async fn provider_catalog(&self) -> Result<Value>
pub async fn provider_catalog(&self) -> Result<Value>
Read the live provider catalog from a remote Soma HTTP server.
Sourcepub async fn ready(&self) -> Result<()>
pub async fn ready(&self) -> Result<()>
Readiness probe: Ok(()) when the upstream dependency is reachable.
Backs the /readyz route. Delegates to the client; no business logic.
Sourcepub fn elicited_name_greeting(&self, outcome: ElicitedNameOutcome<'_>) -> Value
pub fn elicited_name_greeting(&self, outcome: ElicitedNameOutcome<'_>) -> Value
Build the response for the elicited-name demo after the MCP shim collects input.
Sourcepub fn scaffold_intent(&self, input: ScaffoldIntent) -> Result<Value>
pub fn scaffold_intent(&self, input: ScaffoldIntent) -> Result<Value>
Convert elicited scaffold requirements into the handoff contract consumed by the skill.
Trait Implementations§
Source§impl Clone for SomaService
impl Clone for SomaService
Source§fn clone(&self) -> SomaService
fn clone(&self) -> SomaService
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 moreAuto Trait Implementations§
impl Freeze for SomaService
impl !RefUnwindSafe for SomaService
impl Send for SomaService
impl Sync for SomaService
impl Unpin for SomaService
impl UnsafeUnpin for SomaService
impl !UnwindSafe for SomaService
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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