[−][src]Struct vdb::Predicate
Used to compare database entries, e. g. in queries (fn find_*)
Examples
use vdb::{Entry,Predicate}; let a = Entry::new_string("mundo", "world"); assert_eq!(a.compare(&Predicate::new_equal_string("mundo", "world")), true); assert_eq!(a.compare(&Predicate::new_starts_with("mundo", "worl")), true); assert_eq!(a.compare(&Predicate::new_contains("mundo", "orl")), true); assert_eq!(a.compare(&Predicate::new_equal_string("mundo", "planet")), false);
Fields
predicate_type: PredicateType
entry: Entry
Methods
impl Predicate
[src]
pub fn new_equal_i32(name: &str, value: i32) -> Predicate
[src]
Shortcut for creating a new Predicate
that tests for equality with a DbI32
pub fn new_any_string(name: &str) -> Predicate
[src]
Shortcut for creating a new Predicate
that searches database for DbString
s equal to
value
pub fn new_equal_string(name: &str, value: &str) -> Predicate
[src]
Shortcut for creating a new Predicate
that searches database for DbString
s equal to
value
pub fn new_starts_with(name: &str, value: &str) -> Predicate
[src]
Shortcut for creating a new Predicate
that searches database for DbString
s starting
with value
pub fn new_contains(name: &str, value: &str) -> Predicate
[src]
Shortcut for creating a new Predicate
that searches database for DbString
s that contain
value
Trait Implementations
Auto Trait Implementations
impl Sync for Predicate
impl Send for Predicate
impl Unpin for Predicate
impl RefUnwindSafe for Predicate
impl UnwindSafe for Predicate
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,