pub struct AuthorQueryParams {
pub name: Option<String>,
pub surname: Option<String>,
pub email: Option<String>,
}
Expand description
Object that includes the allowed tokens for a search of the /author
resource.
§Description
All the members are optional, which means clients are free to choose what token to use for a search. The current
search logic of the /author
collection resource allows only to use a single token per search. This means that if
multiple tokens are given, the one with the highest priority will be used.
The email hash the highest priority, followed by name and surname.
Fields§
§name: Option<String>
§surname: Option<String>
§email: Option<String>
Implementations§
Source§impl AuthorQueryParams
impl AuthorQueryParams
Sourcepub fn search_token(&self) -> Result<(&str, &str), DataDomainError>
pub fn search_token(&self) -> Result<(&str, &str), DataDomainError>
Returns the token that hash the highest priority in a search.
§Description
AuthorQueryParams includes all the accepted tokens when a client requests a search of an author entry in the DB. All the tokens are marked as optional, to allow clients use the token they prefer. The current search logic only allows a single token search, which means that if multiple tokens are provided within the same request, only one will be considered.
The email hash the highest priority, followed by name and surname. This method inspects what tokens
where provided to the struct
, and returns the one that hash the highest priority. If no token was provided,
an error is returned instead.
Trait Implementations§
Source§impl Debug for AuthorQueryParams
impl Debug for AuthorQueryParams
Source§impl<'de> Deserialize<'de> for AuthorQueryParams
impl<'de> Deserialize<'de> for AuthorQueryParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl IntoParams for AuthorQueryParams
impl IntoParams for AuthorQueryParams
Auto Trait Implementations§
impl Freeze for AuthorQueryParams
impl RefUnwindSafe for AuthorQueryParams
impl Send for AuthorQueryParams
impl Sync for AuthorQueryParams
impl Unpin for AuthorQueryParams
impl UnwindSafe for AuthorQueryParams
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more