pub struct Dest { /* private fields */ }Expand description
Search objects destination. Contains collection and bucket.
Implementations§
Source§impl Dest
impl Dest
Sourcepub fn col_buc(c: impl ToString, b: impl ToString) -> Self
pub fn col_buc(c: impl ToString, b: impl ToString) -> Self
Creates a new destination with collection and bucket.
let dest = Dest::col_buc("wiki", "user:1");
assert_eq!(dest.collection(), "wiki");
assert_eq!(dest.bucket_opt(), Some(&String::from("user:1")));Sourcepub fn col(c: impl ToString) -> Self
pub fn col(c: impl ToString) -> Self
Creates a new destination with collection.
let dest = Dest::col("wiki");
assert_eq!(dest.collection(), "wiki");Sourcepub fn buc(self, b: impl ToString) -> Self
pub fn buc(self, b: impl ToString) -> Self
Set bucket for the destination.
let dest = Dest::col("wiki").buc("user:1");
assert_eq!(dest.collection(), "wiki");
assert_eq!(dest.bucket_opt(), Some(&String::from("user:1")));Sourcepub fn obj(self, o: impl ToString) -> ObjDest
pub fn obj(self, o: impl ToString) -> ObjDest
Set object id to the destination and transform to object destination (ObjDest).
Short for ObjDest::new(dest, object_id)
let dest = Dest::col_buc("wiki", "user:1").obj("article:1");
assert_eq!(dest.collection(), "wiki");
assert_eq!(dest.bucket_opt(), Some(&String::from("user:1")));
assert_eq!(dest.object(), "article:1");Sourcepub fn collection(&self) -> &String
pub fn collection(&self) -> &String
Returns the collection.
Sourcepub fn bucket_opt(&self) -> Option<&String>
pub fn bucket_opt(&self) -> Option<&String>
Returns the optional bucket.
Trait Implementations§
Source§impl From<Dest> for CountRequest
impl From<Dest> for CountRequest
Source§impl From<Dest> for FlushRequest
impl From<Dest> for FlushRequest
impl Eq for Dest
impl StructuralPartialEq for Dest
Auto Trait Implementations§
impl Freeze for Dest
impl RefUnwindSafe for Dest
impl Send for Dest
impl Sync for Dest
impl Unpin for Dest
impl UnwindSafe for Dest
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