pub enum Shard {
Direct(usize),
All,
Unknown,
Blocked,
}
Expand description
What shard, if any, the statement should be sent to.
§Example
use pgdog_plugin::Shard;
// Send query to shard 2.
let direct = Shard::Direct(2);
// Send query to all shards.
let cross_shard = Shard::All;
// Let PgDog handle sharding.
let unknown = Shard::Unknown;
Variants§
Direct(usize)
Direct-to-shard statement, sent to the specified shard only.
All
Send statement to all shards and let PgDog collect and transform the results.
Unknown
Not clear which shard it should go to, so let PgDog decide. Use this if you don’t want to handle sharding inside the plugin.
Blocked
The statement is blocked from executing.
Trait Implementations§
impl Copy for Shard
impl Eq for Shard
impl StructuralPartialEq for Shard
Auto Trait Implementations§
impl Freeze for Shard
impl RefUnwindSafe for Shard
impl Send for Shard
impl Sync for Shard
impl Unpin for Shard
impl UnwindSafe for Shard
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> 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