Trait PathParams

Source
pub trait PathParams: DowncastSync + DynClone {
    // Required methods
    fn size(&self) -> usize;
    fn get(&self, _index: usize) -> (Option<&str>, String);
    fn set(
        &mut self,
        _index: usize,
        _name_and_value: &(Option<&str>, &str),
    ) -> Result<(), SetError>;
    fn verify(
        &self,
        _index: usize,
        _name_and_value: &(Option<&str>, &str),
    ) -> Result<(), SetError>;

    // Provided methods
    fn info(&self) -> PathParamsInfo { ... }
    fn set_from_info(&mut self, info: &PathParamsInfo) -> Result<(), SetError> { ... }
}

Required Methods§

Source

fn size(&self) -> usize

Source

fn get(&self, _index: usize) -> (Option<&str>, String)

Source

fn set( &mut self, _index: usize, _name_and_value: &(Option<&str>, &str), ) -> Result<(), SetError>

Source

fn verify( &self, _index: usize, _name_and_value: &(Option<&str>, &str), ) -> Result<(), SetError>

Provided Methods§

Implementations§

Source§

impl dyn PathParams

Source

pub fn is<__T: PathParams>(&self) -> bool

Returns true if the trait object wraps an object of type __T.

Source

pub fn downcast<__T: PathParams>(self: Box<Self>) -> Result<Box<__T>, Box<Self>>

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

Source

pub fn downcast_rc<__T: PathParams>(self: Rc<Self>) -> Result<Rc<__T>, Rc<Self>>

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

Source

pub fn downcast_ref<__T: PathParams>(&self) -> Option<&__T>

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

Source

pub fn downcast_mut<__T: PathParams>(&mut self) -> Option<&mut __T>

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Trait Implementations§

Source§

impl Debug for dyn PathParams

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Debug for dyn PathParams + Send

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Debug for dyn PathParams + Send + Sync

Source§

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

Formats the value using the given formatter. Read more

Implementations on Foreign Types§

Source§

impl PathParams for (usize, usize)

Source§

fn size(&self) -> usize

Source§

fn get(&self, index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

impl PathParams for (usize, String)

Source§

fn size(&self) -> usize

Source§

fn get(&self, index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

impl PathParams for (String, usize)

Source§

fn size(&self) -> usize

Source§

fn get(&self, index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

impl PathParams for (String, String)

Source§

fn size(&self) -> usize

Source§

fn get(&self, index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, index: usize, (_, _value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

impl PathParams for ()

Source§

fn size(&self) -> usize

Source§

fn get(&self, _index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, _index: usize, (_, _value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, _index: usize, (_, _value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

impl PathParams for usize

Source§

fn size(&self) -> usize

Source§

fn get(&self, index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

impl PathParams for String

Source§

fn size(&self) -> usize

Source§

fn get(&self, index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, index: usize, (_, _value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

impl<T1, T2> PathParams for (PathParam<T1>, PathParam<T2>)
where T1: FromStr + Display + Clone + Default + Send + Sync + 'static, <T1 as FromStr>::Err: Display, T2: FromStr + Display + Clone + Default + Send + Sync + 'static, <T2 as FromStr>::Err: Display,

Source§

fn size(&self) -> usize

Source§

fn get(&self, index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

impl<T1, T2, T3> PathParams for (PathParam<T1>, PathParam<T2>, PathParam<T3>)
where T1: FromStr + Display + Clone + Default + Send + Sync + 'static, <T1 as FromStr>::Err: Display, T2: FromStr + Display + Clone + Default + Send + Sync + 'static, <T2 as FromStr>::Err: Display, T3: FromStr + Display + Clone + Default + Send + Sync + 'static, <T3 as FromStr>::Err: Display,

Source§

fn size(&self) -> usize

Source§

fn get(&self, index: usize) -> (Option<&'static str>, String)

Source§

fn set( &mut self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Source§

fn verify( &self, index: usize, (_, value): &(Option<&str>, &str), ) -> Result<(), SetError>

Implementors§

Source§

impl PathParams for Id

Source§

impl PathParams for Username

Source§

impl<T> PathParams for PathParam<T>
where T: FromStr + Display + Clone + Default + Send + Sync + 'static, <T as FromStr>::Err: Display,