pub struct Arguments { /* private fields */ }Expand description
The values a command was given.
Implementations§
Source§impl Arguments
impl Arguments
Sourcepub fn from_json(command: &Command, object: &Json) -> Result<Arguments, Failed>
pub fn from_json(command: &Command, object: &Json) -> Result<Arguments, Failed>
Builds an argument set from an MCP arguments object.
@param command - the command that declares the accepted arguments @param object - the object the client sent
Sourcepub fn set(&mut self, name: &str, value: Json)
pub fn set(&mut self, name: &str, value: Json)
Records one value.
@param name - the parameter @param value - what was given
Sourcepub fn get(&self, name: &str) -> Option<&Json>
pub fn get(&self, name: &str) -> Option<&Json>
Returns what was given under a name.
@param name - the parameter
Sourcepub fn text(&self, name: &str) -> Option<&str>
pub fn text(&self, name: &str) -> Option<&str>
Returns a text parameter, if it was given as text.
@param name - the parameter
Sourcepub fn required_text(&self, name: &str) -> Result<&str, Failed>
pub fn required_text(&self, name: &str) -> Result<&str, Failed>
Returns a text parameter, or the failure for having left it out.
@param name - the parameter
Sourcepub fn integer(&self, name: &str) -> Option<i64>
pub fn integer(&self, name: &str) -> Option<i64>
Returns an integer parameter.
@param name - the parameter
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Arguments
impl RefUnwindSafe for Arguments
impl Send for Arguments
impl Sync for Arguments
impl Unpin for Arguments
impl UnsafeUnpin for Arguments
impl UnwindSafe for Arguments
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<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