pub struct QueryResult {
pub entities: Vec<EntityBlock>,
pub edges: Vec<EdgeBlock>,
pub has_more: bool,
}Expand description
Complete result of a graph query.
Fields§
§entities: Vec<EntityBlock>Entity blocks (one per entity type in the result).
edges: Vec<EdgeBlock>Edge blocks (one per relation in the result).
has_more: boolWhether there are more results available (pagination).
Implementations§
Source§impl QueryResult
impl QueryResult
Sourcepub fn new(
entities: Vec<EntityBlock>,
edges: Vec<EdgeBlock>,
has_more: bool,
) -> Self
pub fn new( entities: Vec<EntityBlock>, edges: Vec<EdgeBlock>, has_more: bool, ) -> Self
Create a query result with entity and edge blocks.
Sourcepub fn entity_block(&self, entity: &str) -> Option<&EntityBlock>
pub fn entity_block(&self, entity: &str) -> Option<&EntityBlock>
Get an entity block by entity type.
Sourcepub fn edge_block(&self, relation: &str) -> Option<&EdgeBlock>
pub fn edge_block(&self, relation: &str) -> Option<&EdgeBlock>
Get an edge block by relation name.
Sourcepub fn total_entities(&self) -> usize
pub fn total_entities(&self) -> usize
Get total number of entities across all blocks.
Sourcepub fn total_edges(&self) -> usize
pub fn total_edges(&self) -> usize
Get total number of edges across all blocks.
Trait Implementations§
Source§impl Archive for QueryResult
impl Archive for QueryResult
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize. Read moreSource§type Archived = ArchivedQueryResult
type Archived = ArchivedQueryResult
The archived representation of this type. Read more
Source§type Resolver = QueryResultResolver
type Resolver = QueryResultResolver
The resolver for this type. It must contain all the additional
information from serializing needed to make the archived type from
the normal type.
Source§impl Clone for QueryResult
impl Clone for QueryResult
Source§fn clone(&self) -> QueryResult
fn clone(&self) -> QueryResult
Returns a duplicate 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 QueryResult
impl Debug for QueryResult
Source§impl Default for QueryResult
impl Default for QueryResult
Source§impl<'de> Deserialize<'de> for QueryResult
impl<'de> Deserialize<'de> for QueryResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<__D: Fallible + ?Sized> Deserialize<QueryResult, __D> for Archived<QueryResult>where
Vec<EntityBlock>: Archive,
<Vec<EntityBlock> as Archive>::Archived: Deserialize<Vec<EntityBlock>, __D>,
Vec<EdgeBlock>: Archive,
<Vec<EdgeBlock> as Archive>::Archived: Deserialize<Vec<EdgeBlock>, __D>,
bool: Archive,
<bool as Archive>::Archived: Deserialize<bool, __D>,
impl<__D: Fallible + ?Sized> Deserialize<QueryResult, __D> for Archived<QueryResult>where
Vec<EntityBlock>: Archive,
<Vec<EntityBlock> as Archive>::Archived: Deserialize<Vec<EntityBlock>, __D>,
Vec<EdgeBlock>: Archive,
<Vec<EdgeBlock> as Archive>::Archived: Deserialize<Vec<EdgeBlock>, __D>,
bool: Archive,
<bool as Archive>::Archived: Deserialize<bool, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<QueryResult, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<QueryResult, <__D as Fallible>::Error>
Deserializes using the given deserializer
Source§impl PartialEq for QueryResult
impl PartialEq for QueryResult
Source§impl Serialize for QueryResult
impl Serialize for QueryResult
impl StructuralPartialEq for QueryResult
Auto Trait Implementations§
impl Freeze for QueryResult
impl RefUnwindSafe for QueryResult
impl Send for QueryResult
impl Sync for QueryResult
impl Unpin for QueryResult
impl UnwindSafe for QueryResult
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Creates the archived version of the metadata for this value.
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.