#[non_exhaustive]pub struct IndexDef {
pub name: RawIdentifier,
pub source_name: RawIdentifier,
pub accessor_name: Option<Identifier>,
pub algorithm: IndexAlgorithm,
}Expand description
A struct representing the validated definition of a database index.
Cannot be created directly. Construct a ModuleDef by validating a RawModuleDef instead,
and then access the index from there.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: RawIdentifierThe name of the index. Must be unique within the containing ModuleDef.
In V9 and earlier, this was system generated. in V10, this can be optionally passed in by the user, but if not passed in, it will be generated by the system using the same algorithm as V9 and earlier.
source_name: RawIdentifierThis will be the same as name for RawModuleDefV9.
For RawModuleDefV10, this is an auto-generated globally unique name
derived from the module source.
This exists as a hacky workaround to make the index_name_from_id
syscall work without requiring the module to know about the canonical
index name field. It serves as an alias for name in Database.
accessor_name: Option<Identifier>The name of the index to use for client code generation.
In V9 and earlier, this could be supplied by the user via the accessor
macro in bindings. In those versions, this may be None if the index
was auto-generated and no accessor name was provided by the user. In
that case, no client code will be generated for this index.
algorithm: IndexAlgorithmThe algorithm parameters for the index.
Implementations§
Trait Implementations§
Source§impl From<IndexDef> for RawIndexDefV10
impl From<IndexDef> for RawIndexDefV10
Source§impl From<IndexDef> for RawIndexDefV9
impl From<IndexDef> for RawIndexDefV9
Source§impl ModuleDefLookup for IndexDef
impl ModuleDefLookup for IndexDef
Source§type Key<'a> = &'a RawIdentifier
type Key<'a> = &'a RawIdentifier
impl Eq for IndexDef
impl StructuralPartialEq for IndexDef
Auto Trait Implementations§
impl Freeze for IndexDef
impl RefUnwindSafe for IndexDef
impl Send for IndexDef
impl Sync for IndexDef
impl Unpin for IndexDef
impl UnsafeUnpin for IndexDef
impl UnwindSafe for IndexDef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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