pub enum SearchFilterValue {
Str(String),
Bool(bool),
Int(i64),
Float(f64),
List(Vec<String>),
Null,
}
Expand description
A strongly-typed OData filter value.
This covers strings, numbers, booleans, and lists (for search.in
).
Variants§
Implementations§
Source§impl SearchFilterValue
impl SearchFilterValue
Sourcepub fn to_odata(&self) -> Result<String, SearchFilterError>
pub fn to_odata(&self) -> Result<String, SearchFilterError>
Serialize this value into an OData literal.
§Examples
assert_eq!(SearchFilterValue::Str("abc".into()).to_odata()?, "'abc'");
assert_eq!(SearchFilterValue::Int(42).to_odata()?, "42");
assert_eq!(SearchFilterValue::Bool(false).to_odata()?, "false");
assert_eq!(SearchFilterValue::Null.to_odata()?, "null");
§Errors
Returns SearchFilterError::ListNotSupportedInOData
if called on a List
variant,
as lists can only be used with search.in
operations.
Trait Implementations§
Source§impl Clone for SearchFilterValue
impl Clone for SearchFilterValue
Source§fn clone(&self) -> SearchFilterValue
fn clone(&self) -> SearchFilterValue
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SearchFilterValue
impl Debug for SearchFilterValue
Source§impl From<&str> for SearchFilterValue
impl From<&str> for SearchFilterValue
Source§impl From<String> for SearchFilterValue
impl From<String> for SearchFilterValue
Source§impl From<Uuid> for SearchFilterValue
impl From<Uuid> for SearchFilterValue
Source§impl From<bool> for SearchFilterValue
impl From<bool> for SearchFilterValue
Source§impl From<f32> for SearchFilterValue
impl From<f32> for SearchFilterValue
Source§impl From<f64> for SearchFilterValue
impl From<f64> for SearchFilterValue
Source§impl From<i32> for SearchFilterValue
impl From<i32> for SearchFilterValue
Source§impl From<i64> for SearchFilterValue
impl From<i64> for SearchFilterValue
Source§impl PartialEq for SearchFilterValue
impl PartialEq for SearchFilterValue
impl StructuralPartialEq for SearchFilterValue
Auto Trait Implementations§
impl Freeze for SearchFilterValue
impl RefUnwindSafe for SearchFilterValue
impl Send for SearchFilterValue
impl Sync for SearchFilterValue
impl Unpin for SearchFilterValue
impl UnwindSafe for SearchFilterValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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