pub enum ParamDefault {
String(&'static str),
Int(i64),
U64(u64),
U32(u32),
F64(f64),
Bool(bool),
}Expand description
A parameter’s default value, applied when the request omits it. Declared
in routes! as name: Type = default.
Variants§
String(&'static str)
&'static str (not String) so route metadata can live in a
static ROUTES: &[RouteDef] initializer — String::from(...) and
.to_string() aren’t const on stable Rust. Default-application at
runtime borrows the str, allocating only if/when needed.
Int(i64)
A default i64.
U64(u64)
A default u64.
U32(u32)
A default u32.
F64(f64)
A default f64.
Bool(bool)
A default bool.
Trait Implementations§
Source§impl Clone for ParamDefault
impl Clone for ParamDefault
Source§fn clone(&self) -> ParamDefault
fn clone(&self) -> ParamDefault
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ParamDefault
impl RefUnwindSafe for ParamDefault
impl Send for ParamDefault
impl Sync for ParamDefault
impl Unpin for ParamDefault
impl UnsafeUnpin for ParamDefault
impl UnwindSafe for ParamDefault
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