Skip to main content

AnalysisTask

Struct AnalysisTask 

Source
pub struct AnalysisTask<'a, N: Grammar, H: TaskHandle = TriggerHandle, S: SyncBuildHasher = RandomState> { /* private fields */ }
Expand description

A task that grants access to the semantic features of the Analyzer.

This kind of task implements a SemanticAccess trait through which you can read particular attribute values, but you cannot change the content of the documents.

You may have as many instances of this task as needed at the same time, and you can use them from multiple threads to read the attributes. The analyzer is capable to manage the semantic graph concurrently.

Trait Implementations§

Source§

impl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> AbstractTask<N, H, S> for AnalysisTask<'a, N, H, S>

Source§

fn handle(&self) -> &H

Returns a handle of the task through which you can manually check if the task has been interrupted, and through which you can interrupt the task manually.
Source§

fn proceed(&self) -> AnalysisResult<()>

A convenient function that checks if the task was interrupted. Read more
Source§

fn contains_doc(&self, id: Id) -> bool

Returns true, if the analyzer has a document with the id identifier.
Source§

fn read_doc(&self, id: Id) -> AnalysisResult<DocumentReadGuard<'_, N, S>>

Returns a RAII guard that provides read-only access to the analyzer’s document with specified id. Read more
Source§

fn try_read_doc(&self, id: Id) -> Option<DocumentReadGuard<'_, N, S>>

Returns a RAII guard that provides read-only access to the analyzer’s document with specified id. Read more
Source§

fn is_doc_mutable(&self, id: Id) -> bool

Returns true if the document with the specified id exists in the analyzer, and this document allows content edit operations.
Source§

fn is_doc_immutable(&self, id: Id) -> bool

Returns true if the document with the specified id exists in the analyzer, and this document does not allow content edit operations.
Source§

fn snapshot_class( &self, id: Id, class: &<N::Classifier as Classifier>::Class, ) -> AnalysisResult<Shared<HashSet<NodeRef, S>>>

Returns a snapshot of the node references set of the document with id that refer to syntax tree nodes belonging to specified class. Read more
Source§

fn common(&self) -> &N::CommonSemantics

Provides access to the Analyzer’s common semantics, a special semantic feature that is instantiated during the Analyzer’s creation. It does not belong to any specific document and is common across the entire Analyzer. Read more
Source§

impl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> Drop for AnalysisTask<'a, N, H, S>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> SemanticAccess<N, H, S> for AnalysisTask<'a, N, H, S>

Auto Trait Implementations§

§

impl<'a, N, H, S> Freeze for AnalysisTask<'a, N, H, S>
where &'a Analyzer<N, H, S>: Freeze, &'a H: Freeze,

§

impl<'a, N, H, S> RefUnwindSafe for AnalysisTask<'a, N, H, S>
where &'a Analyzer<N, H, S>: RefUnwindSafe, &'a H: RefUnwindSafe,

§

impl<'a, N, H, S> Send for AnalysisTask<'a, N, H, S>
where &'a Analyzer<N, H, S>: Send, &'a H: Send,

§

impl<'a, N, H, S> Sync for AnalysisTask<'a, N, H, S>
where &'a Analyzer<N, H, S>: Sync, &'a H: Sync,

§

impl<'a, N, H, S> Unpin for AnalysisTask<'a, N, H, S>
where &'a Analyzer<N, H, S>: Unpin, &'a H: Unpin,

§

impl<'a, N, H, S> UnsafeUnpin for AnalysisTask<'a, N, H, S>
where &'a Analyzer<N, H, S>: UnsafeUnpin, &'a H: UnsafeUnpin,

§

impl<'a, N, H, S> UnwindSafe for AnalysisTask<'a, N, H, S>
where &'a Analyzer<N, H, S>: UnwindSafe, &'a H: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.