Struct openrpc_types::resolved::Method
source · pub struct Method {Show 13 fields
pub name: String,
pub tags: Option<Vec<Tag>>,
pub summary: Option<String>,
pub description: Option<String>,
pub external_docs: Option<ExternalDocumentation>,
pub params: Vec<ContentDescriptor>,
pub result: Option<ContentDescriptor>,
pub deprecated: Option<bool>,
pub servers: Option<Vec<Server>>,
pub errors: Option<Vec<Error>>,
pub param_structure: Option<ParamStructure>,
pub examples: Option<Vec<ExamplePairing>>,
pub extensions: SpecificationExtensions,
}
Expand description
Describes the interface for the given method name. The method name is used as the method field of the JSON-RPC body. It therefore MUST be unique.
Fields§
§name: String
REQUIRED. The cannonical name for the method. The name MUST be unique within the methods array.
A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier.
summary: Option<String>
A short summary of what the method does.
description: Option<String>
A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation.
external_docs: Option<ExternalDocumentation>
Additional external documentation for this method.
params: Vec<ContentDescriptor>
REQUIRED. A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require name to be unique. The list can use the Reference Object to link to parameters that are defined by the Content Descriptor Object. All optional params (content descriptor objects with “required”: false) MUST be positioned after all required params in the list.
result: Option<ContentDescriptor>
The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a notification.
deprecated: Option<bool>
Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is
false
.
servers: Option<Vec<Server>>
An alternative servers array to service this method. If an alternative servers array is specified at the Root level, it will be overridden by this value.
errors: Option<Vec<Error>>
A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes.
param_structure: Option<ParamStructure>
§examples: Option<Vec<ExamplePairing>>
Array of Example Pairing Objects where each example includes a valid params-to-result Content Descriptor pairing.
extensions: SpecificationExtensions
Trait Implementations§
source§impl<'de> Deserialize<'de> for Method
impl<'de> Deserialize<'de> for Method
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for Method
impl PartialEq 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 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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)