pub struct Shard {
pub id: ShardId,
pub status: ShardStatus,
/* private fields */
}Expand description
A single shard containing a partition of the search corpus
Fields§
§id: ShardIdUnique shard identifier
status: ShardStatusStatus of this shard
Implementations§
Source§impl Shard
impl Shard
Sourcepub fn query(
&self,
query: &SparseVec,
config: &SearchConfig,
k: usize,
) -> Vec<ShardResult>
pub fn query( &self, query: &SparseVec, config: &SearchConfig, k: usize, ) -> Vec<ShardResult>
Query this shard locally
Sourcepub fn query_count(&self) -> u64
pub fn query_count(&self) -> u64
Get query count
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Check if shard is available for queries
Sourcepub fn set_status(&mut self, status: ShardStatus)
pub fn set_status(&mut self, status: ShardStatus)
Update shard status
Trait Implementations§
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> 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