pub struct DatasetQuery<'a> { /* private fields */ }Expand description
Read-only query interface over a binary LXDB dataset.
The query borrows the dataset and does not allocate an intermediate graph.
Implementations§
Source§impl<'a> DatasetQuery<'a>
impl<'a> DatasetQuery<'a>
pub const fn new(dataset: &'a BinaryDataset) -> Self
pub const fn dataset(&self) -> &'a BinaryDataset
Sourcepub fn token_by_text(
&self,
text: &str,
) -> Result<Option<BinaryToken<'a>>, EngineError>
pub fn token_by_text( &self, text: &str, ) -> Result<Option<BinaryToken<'a>>, EngineError>
Finds the first token whose text exactly matches text.
This performs a linear scan over the token records.
pub fn token_by_id( &self, token_id: TokenId, ) -> Result<Option<BinaryToken<'a>>, EngineError>
pub fn outgoing( &self, token_id: TokenId, ) -> Result<RelationRecordIter<'a>, EngineError>
Sourcepub fn resolved_outgoing(
&self,
token_id: TokenId,
) -> Result<BinaryRelationIter<'a>, EngineError>
pub fn resolved_outgoing( &self, token_id: TokenId, ) -> Result<BinaryRelationIter<'a>, EngineError>
Resolves all outgoing relations for a token.
Finds a token by text and resolves its outgoing relations.
Ok(None) means that no token exists with the provided text.
Trait Implementations§
Source§impl<'a> Clone for DatasetQuery<'a>
impl<'a> Clone for DatasetQuery<'a>
Source§fn clone(&self) -> DatasetQuery<'a>
fn clone(&self) -> DatasetQuery<'a>
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 moreimpl<'a> Copy for DatasetQuery<'a>
Auto Trait Implementations§
impl<'a> Freeze for DatasetQuery<'a>
impl<'a> RefUnwindSafe for DatasetQuery<'a>
impl<'a> Send for DatasetQuery<'a>
impl<'a> Sync for DatasetQuery<'a>
impl<'a> Unpin for DatasetQuery<'a>
impl<'a> UnsafeUnpin for DatasetQuery<'a>
impl<'a> UnwindSafe for DatasetQuery<'a>
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