#[non_exhaustive]pub struct FunctionSpec {
pub description: Cow<'static, str>,
pub category: Cow<'static, str>,
pub retry: RetrySafety,
pub references: Vec<Reference>,
pub runtime_fields: Option<Vec<FieldSpec>>,
}Expand description
What a function says about itself, for tooling. Data only.
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.description: Cow<'static, str>What the function does.
category: Cow<'static, str>The group it is listed under.
retry: RetrySafetyWhether a retry is safe.
references: Vec<Reference>The config fields that name other definitions.
runtime_fields: Option<Vec<FieldSpec>>The config’s fields, when a plugin declares them at runtime.
Implementations§
Source§impl FunctionSpec
impl FunctionSpec
Sourcepub fn with_description(self, description: impl Into<Cow<'static, str>>) -> Self
pub fn with_description(self, description: impl Into<Cow<'static, str>>) -> Self
Sets the description.
Sourcepub fn with_category(self, category: impl Into<Cow<'static, str>>) -> Self
pub fn with_category(self, category: impl Into<Cow<'static, str>>) -> Self
Sets the category.
Sourcepub fn with_retry(self, retry: RetrySafety) -> Self
pub fn with_retry(self, retry: RetrySafety) -> Self
Sets the retry safety.
Sourcepub fn with_references(self, references: Vec<Reference>) -> Self
pub fn with_references(self, references: Vec<Reference>) -> Self
Sets the references.
Sourcepub fn with_runtime_fields(self, fields: Vec<FieldSpec>) -> Self
pub fn with_runtime_fields(self, fields: Vec<FieldSpec>) -> Self
Sets the runtime-declared fields.
Trait Implementations§
Source§impl Clone for FunctionSpec
impl Clone for FunctionSpec
Source§impl Debug for FunctionSpec
impl Debug for FunctionSpec
Auto Trait Implementations§
impl Freeze for FunctionSpec
impl RefUnwindSafe for FunctionSpec
impl Send for FunctionSpec
impl Sync for FunctionSpec
impl Unpin for FunctionSpec
impl UnsafeUnpin for FunctionSpec
impl UnwindSafe for FunctionSpec
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