pub struct Context { /* private fields */ }Expand description
What a method knows about the call it answers.
Implementations§
Source§impl Context
impl Context
Sourcepub fn try_new(
run: &str,
call: &str,
spec: &TypeSpec,
schema: Option<Json>,
types: Option<Json>,
cancelled: Arc<AtomicBool>,
) -> Result<Context, DecodeError>
pub fn try_new( run: &str, call: &str, spec: &TypeSpec, schema: Option<Json>, types: Option<Json>, cancelled: Arc<AtomicBool>, ) -> Result<Context, DecodeError>
Validates the complete call views before making an author context.
Sourcepub fn types(&self) -> Option<&ValidatedTypes>
pub fn types(&self) -> Option<&ValidatedTypes>
The admitted concrete type description, if this Tool is generic.
Sourcepub fn codec(&self, name: &str) -> Result<ContextCodec, DecodeError>
pub fn codec(&self, name: &str) -> Result<ContextCodec, DecodeError>
A generic binding’s owned codec, when that binding crosses the boundary.
Sourcepub fn argument_codec(&self, name: &str) -> Result<ContextCodec, DecodeError>
pub fn argument_codec(&self, name: &str) -> Result<ContextCodec, DecodeError>
An argument’s owned concrete codec.
Sourcepub fn success_codec(&self) -> Result<ContextCodec, DecodeError>
pub fn success_codec(&self) -> Result<ContextCodec, DecodeError>
The owned success codec.
Sourcepub fn failure_codec(&self) -> Result<ContextCodec, DecodeError>
pub fn failure_codec(&self) -> Result<ContextCodec, DecodeError>
The owned failure codec.
Sourcepub fn schema(&self) -> Option<&Json>
pub fn schema(&self) -> Option<&Json>
For a generic Tool, the schema of the success type the caller expects.
Sourcepub fn log(&self, level: &str, message: &str) -> Result<()>
pub fn log(&self, level: &str, message: &str) -> Result<()>
Writes one call-correlated operational log record outside protocol stdout.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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