Struct rusqbin::models::Id
[−]
[src]
pub struct Id(_);
Id type for Request Bins. Wraps a String.
JSON encodes to just a plain ol' String (as opposed to an object).
To construct an Id, use an IdExtractor's parse method, or use the static random()
method.
let id = Id::random(); let id_extractor = IdExtractor::new(); let parsed_id = { let id_as_str = id.value(); id_extractor.parse(id_as_str) }; assert_eq!(parsed_id, Some(id)); let nope = id_extractor.parse("lulz"); assert_eq!(nope, None);Run
Methods
impl Id
[src]
Trait Implementations
impl PartialEq for Id
[src]
fn eq(&self, __arg_0: &Id) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Id) -> bool
This method tests for !=
.
impl Debug for Id
[src]
impl Eq for Id
[src]
impl Hash for Id
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the state provided.
impl Clone for Id
[src]
fn clone(&self) -> Id
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more