pub struct ValidateConfigParams {
pub config: ShardexConfig,
}Expand description
Parameters for validating a ShardexConfig
Contains a ShardexConfig to be validated without creating or opening an index. This is useful for testing configuration validity before performing operations.
Fields§
§config: ShardexConfigThe configuration to validate
Implementations§
Source§impl ValidateConfigParams
impl ValidateConfigParams
Sourcepub fn new(config: ShardexConfig) -> Self
pub fn new(config: ShardexConfig) -> Self
Create new validate config parameters
§Arguments
config- The ShardexConfig to validate
§Example
use shardex::api::parameters::ValidateConfigParams;
use shardex::ShardexConfig;
let config = ShardexConfig::new().vector_size(384).shard_size(10000);
let params = ValidateConfigParams::new(config);
assert_eq!(params.config.vector_size, 384);Sourcepub fn validate(&self) -> Result<(), ShardexError>
pub fn validate(&self) -> Result<(), ShardexError>
Validate the parameters
This validates the contained ShardexConfig and always succeeds for ValidateConfigParams itself (the config validation is the operation).
§Errors
Returns ShardexError::Config if the contained configuration is invalid.
Sourcepub fn get_config(&self) -> &ShardexConfig
pub fn get_config(&self) -> &ShardexConfig
Get a reference to the configuration
Trait Implementations§
Source§impl ApiOperation<ShardexContext, ValidateConfigParams> for ValidateConfig
impl ApiOperation<ShardexContext, ValidateConfigParams> for ValidateConfig
Source§type Error = ShardexError
type Error = ShardexError
The error type returned when an operation fails.
Source§fn execute(
_context: &mut ShardexContext,
parameters: &ValidateConfigParams,
) -> Result<Self::Output, Self::Error>
fn execute( _context: &mut ShardexContext, parameters: &ValidateConfigParams, ) -> Result<Self::Output, Self::Error>
Execute the API operation with the given context and properties.
Source§impl Clone for ValidateConfigParams
impl Clone for ValidateConfigParams
Source§fn clone(&self) -> ValidateConfigParams
fn clone(&self) -> ValidateConfigParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ValidateConfigParams
impl RefUnwindSafe for ValidateConfigParams
impl Send for ValidateConfigParams
impl Sync for ValidateConfigParams
impl Unpin for ValidateConfigParams
impl UnsafeUnpin for ValidateConfigParams
impl UnwindSafe for ValidateConfigParams
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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