Struct sonic_channel::Dest
source · [−]pub struct Dest { /* private fields */ }
Expand description
Search objects destination. Contains collection and bucket.
Implementations
sourceimpl 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
sourceimpl From<Dest> for CountRequest
impl From<Dest> for CountRequest
sourceimpl From<Dest> for FlushRequest
impl From<Dest> for FlushRequest
impl Eq for Dest
impl StructuralEq for Dest
impl StructuralPartialEq for Dest
Auto Trait Implementations
impl RefUnwindSafe for Dest
impl Send for Dest
impl Sync for Dest
impl Unpin for Dest
impl UnwindSafe for Dest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more