pub struct Method {
pub kind: String,
pub parameters: Option<Schema>,
pub input: Option<Schema>,
pub output: Option<Schema>,
pub errors: Vec<String>,
}Expand description
A query, procedure, subscription or permission-set definition.
Everything a method declares that is a schema, and nothing else. The
encoding strings are not kept: a method whose output is application/cbor
or */* carries no schema and is Method::output None, which is the
only thing a caller can act on.
Fields§
§kind: StringThe definition’s type, as written.
parameters: Option<Schema>The parameters object, when the method declares one.
Query parameters arrive as strings and are coerced by whatever parsed the request, so this is here to be read rather than to check a request body against.
input: Option<Schema>The schema of a JSON request body, when the method takes one.
output: Option<Schema>The schema of a JSON response body, when the method returns one.
errors: Vec<String>The error names the method declares, in the order the document lists them.
A client generates a typed class per name, so an error this server invents is one the client reports as an unknown failure rather than as the condition it is.
Trait Implementations§
impl Eq for Method
impl StructuralPartialEq for Method
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnsafeUnpin for Method
impl UnwindSafe for Method
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.