Skip to main content

FuncParam

Struct FuncParam 

Source
pub struct FuncParam {
    pub name: String,
    pub param_type: Option<TypeTag>,
    pub allowed: Option<&'static [&'static str]>,
    pub docs: &'static str,
    pub options: Option<&'static [ParamOption]>,
    pub optional: bool,
}
Expand description

One declared parameter of a registered function. param_type is None for unconstrained Value parameters (the macro accepts any value). allowed names the closed value set for constrained STRING parameters, declared once via #[values(...)]: the generated extractor enforces membership and the reference renders the set, so the list cannot rot apart from the check. docs carries the parameter’s description (parsed from the # Arguments doc section for macro functions, written inline for hand-built entries) and renders into every reference surface. options declares the known keys of a MAP options parameter: same single-source rule as allowed, with per-key types, required flags, defaults, and docs. optional marks a trailing MAP parameter callers may omit: the runtime fills an empty MAP, and signatures render = {}. Only trailing MAP params may be optional (run-start validation rejects anything else), so omission always means “no options”. The macro never emits optional params: only hand-built entries use them, and only for options MAPs.

Fields§

§name: String§param_type: Option<TypeTag>§allowed: Option<&'static [&'static str]>§docs: &'static str§options: Option<&'static [ParamOption]>§optional: bool

Trait Implementations§

Source§

impl Clone for FuncParam

Source§

fn clone(&self) -> FuncParam

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FuncParam

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for FuncParam

§

impl Freeze for FuncParam
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const ArcInner<TypeTag> is !null: Freeze, PhantomData<ArcInner<TypeTag>>: Freeze, &'static TypeDescriptor: Freeze, *const ArcInner<[Field]> is !null: Freeze, PhantomData<ArcInner<[Field]>>: Freeze, *const ArcInner<str> is !null: Freeze, PhantomData<ArcInner<str>>: Freeze, *const ArcInner<[TypeTag]> is !null: Freeze, PhantomData<ArcInner<[TypeTag]>>: Freeze, &'static [&'static str]: Freeze, &'static str: Freeze, &'static [ParamOption]: Freeze,

§

impl Move for FuncParam

§

impl RefUnwindSafe for FuncParam

§

impl Send for FuncParam
where RawVecInner: Send, Arc<TypeTag>: Send, &'static TypeDescriptor: Send, Arc<[Field]>: Send, Arc<str>: Send, Arc<[TypeTag]>: Send, &'static [&'static str]: Send, &'static str: Send, &'static [ParamOption]: Send,

§

impl Sync for FuncParam
where RawVecInner: Sync, Arc<TypeTag>: Sync, Arc<[Field]>: Sync, Arc<str>: Sync, Arc<[TypeTag]>: Sync,

§

impl Unpin for FuncParam
where *const u8 is !null: Unpin, Arc<TypeTag>: Unpin, &'static TypeDescriptor: Unpin, Arc<[Field]>: Unpin, Arc<str>: Unpin, Arc<[TypeTag]>: Unpin, &'static [&'static str]: Unpin, &'static str: Unpin, &'static [ParamOption]: Unpin,

§

impl UnsafeUnpin for FuncParam
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const ArcInner<TypeTag> is !null: UnsafeUnpin, PhantomData<ArcInner<TypeTag>>: UnsafeUnpin, &'static TypeDescriptor: UnsafeUnpin, *const ArcInner<[Field]> is !null: UnsafeUnpin, PhantomData<ArcInner<[Field]>>: UnsafeUnpin, *const ArcInner<str> is !null: UnsafeUnpin, PhantomData<ArcInner<str>>: UnsafeUnpin, *const ArcInner<[TypeTag]> is !null: UnsafeUnpin, PhantomData<ArcInner<[TypeTag]>>: UnsafeUnpin, &'static [&'static str]: UnsafeUnpin, &'static str: UnsafeUnpin, &'static [ParamOption]: UnsafeUnpin,

§

impl UnwindSafe for FuncParam
where RawVecInner: UnwindSafe, Arc<TypeTag>: UnwindSafe, &'static TypeDescriptor: UnwindSafe, Arc<[Field]>: UnwindSafe, Arc<str>: UnwindSafe, Arc<[TypeTag]>: UnwindSafe, &'static [&'static str]: UnwindSafe, &'static str: UnwindSafe, &'static [ParamOption]: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more