Struct parser_database::IndexFieldPath
source · pub struct IndexFieldPath { /* private fields */ }
Expand description
Defines a path to a field that is not directly in the model.
ⓘ
type A {
field String
}
model A {
id Int @id
a A
@@index([a.field])
// ^this thing here, path separated with `.`
}
Implementations§
source§impl IndexFieldPath
impl IndexFieldPath
sourcepub fn root(&self) -> ScalarFieldId
pub fn root(&self) -> ScalarFieldId
The starting point of the index path. If the indexed field is not in a
composite type, returns the same value as field_in_index
.
ⓘ
type A {
field String
}
model A {
id Int @id
a A
//^here
@@index([a.field])
}
sourcepub fn path(&self) -> &[(CompositeTypeId, FieldId)]
pub fn path(&self) -> &[(CompositeTypeId, FieldId)]
sourcepub fn field_in_index(
&self
) -> Either<ScalarFieldId, (CompositeTypeId, FieldId)>
pub fn field_in_index( &self ) -> Either<ScalarFieldId, (CompositeTypeId, FieldId)>
The field that gets included in the index. Can either be in the model,
or in a composite type embedded in the model. Returns the same value as
the root
method if the field is in a model rather than in a
composite type.
Trait Implementations§
source§impl Clone for IndexFieldPath
impl Clone for IndexFieldPath
source§fn clone(&self) -> IndexFieldPath
fn clone(&self) -> IndexFieldPath
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for IndexFieldPath
impl Debug for IndexFieldPath
source§impl PartialEq for IndexFieldPath
impl PartialEq for IndexFieldPath
source§fn eq(&self, other: &IndexFieldPath) -> bool
fn eq(&self, other: &IndexFieldPath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for IndexFieldPath
Auto Trait Implementations§
impl RefUnwindSafe for IndexFieldPath
impl Send for IndexFieldPath
impl Sync for IndexFieldPath
impl Unpin for IndexFieldPath
impl UnwindSafe for IndexFieldPath
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