pub struct ExclusiveTask<'a, N: Grammar, H: TaskHandle = TriggerHandle, S: SyncBuildHasher = RandomState> { /* private fields */ }Expand description
An exclusive task that grants access to change documents and to observe the semantic graph of the Analyzer.
This task implements a MutationAccess trait through which you can create, delete, or edit the existing documents’ content, and implements a SemanticAccess trait through which you can read particular attribute values.
You can request both kinds of operations sequentially in a single thread, but the Analyzer does not allow you to have more than one active Exclusive task, and exclusive access is granted if and only if no other types of active tasks are granted.
Trait Implementations§
Source§impl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> AbstractTask<N, H, S> for ExclusiveTask<'a, N, H, S>
impl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> AbstractTask<N, H, S> for ExclusiveTask<'a, N, H, S>
Source§fn handle(&self) -> &H
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<()>
fn proceed(&self) -> AnalysisResult<()>
A convenient function that checks if the task was interrupted. Read more
Source§fn contains_doc(&self, id: Id) -> bool
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>>
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 moreSource§fn try_read_doc(&self, id: Id) -> Option<DocumentReadGuard<'_, N, S>>
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 moreSource§fn is_doc_mutable(&self, id: Id) -> bool
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
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>>>
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 moreSource§fn common(&self) -> &N::CommonSemantics
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 ExclusiveTask<'a, N, H, S>
impl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> Drop for ExclusiveTask<'a, N, H, S>
Source§impl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> MutationAccess<N, H, S> for ExclusiveTask<'a, N, H, S>
impl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> MutationAccess<N, H, S> for ExclusiveTask<'a, N, H, S>
Source§fn add_mutable_doc(&mut self, text: impl Into<TokenBuffer<N::Token>>) -> Id
fn add_mutable_doc(&mut self, text: impl Into<TokenBuffer<N::Token>>) -> Id
Source§fn add_immutable_doc(&mut self, text: impl Into<TokenBuffer<N::Token>>) -> Id
fn add_immutable_doc(&mut self, text: impl Into<TokenBuffer<N::Token>>) -> Id
Source§fn write_to_doc(
&mut self,
id: Id,
span: impl ToSpan,
text: impl AsRef<str>,
) -> AnalysisResult<()>
fn write_to_doc( &mut self, id: Id, span: impl ToSpan, text: impl AsRef<str>, ) -> AnalysisResult<()>
Source§fn remove_doc(&mut self, id: Id) -> bool
fn remove_doc(&mut self, id: Id) -> bool
Source§fn trigger_event(&mut self, id: Id, event: Event)
fn trigger_event(&mut self, id: Id, event: Event)
Invalidates semantic graph attributes
associated with the corresponding
event and the id parameters. Read moreimpl<'a, N: Grammar, H: TaskHandle, S: SyncBuildHasher> SemanticAccess<N, H, S> for ExclusiveTask<'a, N, H, S>
Auto Trait Implementations§
impl<'a, N, H, S> Freeze for ExclusiveTask<'a, N, H, S>
impl<'a, N, H, S> RefUnwindSafe for ExclusiveTask<'a, N, H, S>
impl<'a, N, H, S> Send for ExclusiveTask<'a, N, H, S>
impl<'a, N, H, S> Sync for ExclusiveTask<'a, N, H, S>
impl<'a, N, H, S> Unpin for ExclusiveTask<'a, N, H, S>
impl<'a, N, H, S> UnsafeUnpin for ExclusiveTask<'a, N, H, S>
impl<'a, N, H, S> UnwindSafe for ExclusiveTask<'a, N, H, S>
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