#[non_exhaustive]pub struct Method {
pub name: String,
pub request_type_url: String,
pub request_streaming: bool,
pub response_type_url: String,
pub response_streaming: bool,
pub options: Vec<Option>,
pub syntax: Syntax,
}Expand description
Method represents a method of an API interface.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringThe simple name of this method.
request_type_url: StringA URL of the input message type.
request_streaming: boolIf true, the request is streamed.
response_type_url: StringThe URL of the output message type.
response_streaming: boolIf true, the response is streamed.
options: Vec<Option>Any metadata attached to the method.
syntax: SyntaxThe source syntax of this method.
Implementations§
Source§impl Method
impl Method
Sourcepub fn set_request_type_url<T: Into<String>>(self, v: T) -> Self
pub fn set_request_type_url<T: Into<String>>(self, v: T) -> Self
Sets the value of request_type_url.
Sourcepub fn set_request_streaming<T: Into<bool>>(self, v: T) -> Self
pub fn set_request_streaming<T: Into<bool>>(self, v: T) -> Self
Sets the value of request_streaming.
Sourcepub fn set_response_type_url<T: Into<String>>(self, v: T) -> Self
pub fn set_response_type_url<T: Into<String>>(self, v: T) -> Self
Sets the value of response_type_url.
Sourcepub fn set_response_streaming<T: Into<bool>>(self, v: T) -> Self
pub fn set_response_streaming<T: Into<bool>>(self, v: T) -> Self
Sets the value of response_streaming.
Sourcepub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
pub fn set_syntax<T: Into<Syntax>>(self, v: T) -> Self
Sets the value of syntax.
Sourcepub fn set_options<T, V>(self, v: T) -> Self
pub fn set_options<T, V>(self, v: T) -> Self
Sets the value of options.
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more