Struct ModuleWriteGuard

Source
pub struct ModuleWriteGuard<'a, H: TaskHandle = TriggerHandle> { /* private fields */ }
Expand description

An object that grants exclusive access to the ScriptModule content.

Created by the write and try_write functions.

Implements the ModuleRead trait, which provides content read functions, and the ModuleWrite trait, which provides content write functions and read functions that require exclusive access.

Trait Implementations§

Source§

impl<'a, H: TaskHandle> Identifiable for ModuleWriteGuard<'a, H>

Source§

fn id(&self) -> Id

Returns the globally unique identifier of the compilation unit to which this object belongs.
Source§

impl<'a, H: TaskHandle> ModuleRead<H> for ModuleWriteGuard<'a, H>

Source§

fn package(&self) -> &'static PackageMeta

Returns the metadata object of the script package under which the underlying ScriptModule is being analyzed. Read more
Source§

fn is_interrupted(&self) -> bool

Returns true if the underlying access guard has been revoked. Read more
Source§

fn text(&self) -> ModuleText<'_>

Gets access to the script module’s source code text. Read more
Source§

fn diagnostics( &self, depth: DiagnosticsDepth, ) -> ModuleResult<ModuleDiagnostics>

Computes script module diagnostics (errors and warnings). Read more
Source§

fn symbols( &self, span: impl ToSpan, options: LookupOptions, ) -> ModuleResult<Vec<ModuleSymbol>>

Looks up syntax constructions within the specified span (source code range) based on the options filter. Read more
Source§

fn content_origin(&self) -> ScriptOrigin

Returns a range of the source code without the header and footer comments. Read more
Source§

fn compile(&self) -> ModuleResult<ScriptFn>

Compiles the source code into the Ad Astra assembly, making it available for execution. To execute the resulting ScriptFn object, use the ScriptFn::run function. Read more
Source§

impl<'a, H: TaskHandle> ModuleWrite<H> for ModuleWriteGuard<'a, H>

Source§

fn edit(&mut self, span: impl ToSpan, text: impl AsRef<str>) -> ModuleResult<()>

Mutates the source code text of the script module. Read more
Source§

fn completions(&mut self, site: impl ToSite) -> ModuleResult<Completions>

Returns a Completions description object that describes potential completions for the script module’s source code at the specified site position. Read more

Auto Trait Implementations§

§

impl<'a, H> Freeze for ModuleWriteGuard<'a, H>

§

impl<'a, H = TriggerHandle> !RefUnwindSafe for ModuleWriteGuard<'a, H>

§

impl<'a, H> Send for ModuleWriteGuard<'a, H>

§

impl<'a, H> Sync for ModuleWriteGuard<'a, H>

§

impl<'a, H> Unpin for ModuleWriteGuard<'a, H>

§

impl<'a, H = TriggerHandle> !UnwindSafe for ModuleWriteGuard<'a, H>

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.