Struct reflectapi::Function
source · pub struct Function {
pub name: String,
pub path: String,
pub description: String,
pub input_type: Option<TypeReference>,
pub input_headers: Option<TypeReference>,
pub output_type: Option<TypeReference>,
pub error_type: Option<TypeReference>,
pub serialization: Vec<SerializationMode>,
pub readonly: bool,
}
Fields§
§name: String
Includes entity and action, for example: users.login
path: String
URL mounting path, for example: /api/v1
description: String
Description of the call
input_type: Option<TypeReference>
§input_headers: Option<TypeReference>
§output_type: Option<TypeReference>
§error_type: Option<TypeReference>
§serialization: Vec<SerializationMode>
Supported content types for request and response bodies.
Note: serialization for header values is not affected by this field. For displayable types of fields, it is encoded in plain strings. For non-displayable types, it is encoded as json.
Default: only json if empty
readonly: bool
If a function is readonly, it means it does not modify the state of an application
Implementations§
source§impl Function
impl Function
pub fn new(name: String) -> Function
pub fn name(&self) -> &str
pub fn path(&self) -> &str
pub fn description(&self) -> &str
pub fn input_type(&self) -> Option<&TypeReference>
pub fn input_headers(&self) -> Option<&TypeReference>
pub fn output_type(&self) -> Option<&TypeReference>
pub fn error_type(&self) -> Option<&TypeReference>
pub fn serialization(&self) -> Iter<'_, SerializationMode>
pub fn readonly(&self) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Function
impl<'de> Deserialize<'de> for Function
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Function, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Function, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for Function
impl Serialize for Function
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl Send for Function
impl Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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