pub struct Pipeline { /* private fields */ }
Expand description
§Pipeline
A pipeline can be used to send multiple queries at once to the server. Queries in a pipeline are executed independently of one another, but they are executed serially unless otherwise configured
Implementations§
source§impl Pipeline
impl Pipeline
sourcepub fn query_count(&self) -> usize
pub fn query_count(&self) -> usize
Returns the number of queries that were appended to this pipeline
sourcepub fn push_owned(&mut self, q: Query)
pub fn push_owned(&mut self, q: Query)
Same as Self::push
, but passes ownership to the Pipeline
sourcepub fn push(&mut self, q: &Query)
pub fn push(&mut self, q: &Query)
Add a query to this pipeline
Note: It’s not possible to get the query back from the pipeline since it’s not indexed (and doing so would be an unnecessary
waste of space and time). That’s why we take a reference which allows the caller to continue owning the Query
item
sourcepub fn add(self, q: &Query) -> Self
pub fn add(self, q: &Query) -> Self
Add a query to this pipeline (builder pattern)
This is intended to be used with the “builder pattern”. For example:
use skytable::{query, Pipeline};
let pipeline = Pipeline::new()
.add(&query!("create space myspace"))
.add(&query!("drop space myspace"));
assert_eq!(pipeline.query_count(), 2);
Trait Implementations§
source§impl<Q: AsRef<Query>> Extend<Q> for Pipeline
impl<Q: AsRef<Query>> Extend<Q> for Pipeline
source§fn extend<T: IntoIterator<Item = Q>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Q>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl Freeze for Pipeline
impl RefUnwindSafe for Pipeline
impl Send for Pipeline
impl Sync for Pipeline
impl Unpin for Pipeline
impl UnwindSafe for Pipeline
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