Struct ResolvedSourceUnit
pub struct ResolvedSourceUnit { /* private fields */ }Description
One UTF-8 source unit belonging to a resolved package namespace.
Implementations§
§impl ResolvedSourceUnit
impl ResolvedSourceUnit
pub fn new(
namespace: CompilationNamespaceId,
file: impl Into<String>,
source: impl Into<String>,
) -> Result<ResolvedSourceUnit, Diagnostic>
pub fn new( namespace: CompilationNamespaceId, file: impl Into<String>, source: impl Into<String>, ) -> Result<ResolvedSourceUnit, Diagnostic>
Construct a source unit from its portable path below the src/ root.
The path is the sole logical module identity. For example,
src/models/main.eqi belongs to models.main.
§Errors
Rejects paths outside src/, non-.eqi files, and path segments that
are not Eqiora identifiers.
pub fn with_resolved_arrays(
self,
arrays: Arc<BTreeMap<String, ResolvedF64Array>>,
) -> Result<ResolvedSourceUnit, Diagnostic>
pub fn with_resolved_arrays( self, arrays: Arc<BTreeMap<String, ResolvedF64Array>>, ) -> Result<ResolvedSourceUnit, Diagnostic>
Attach the owning package’s verified immutable data assets.
§Errors
Rejects invalid names, a repeated attachment, or arrays that exceed the array-work or hierarchy-input limits.
pub fn resolved_arrays(&self) -> &BTreeMap<String, ResolvedF64Array>
pub fn resolved_arrays(&self) -> &BTreeMap<String, ResolvedF64Array>
Array names and immutable payloads of the owning package, available to this unit.
pub fn with_resolved_documents(
self,
documents: Arc<BTreeMap<String, Arc<[u8]>>>,
) -> Result<ResolvedSourceUnit, Diagnostic>
pub fn with_resolved_documents( self, documents: Arc<BTreeMap<String, Arc<[u8]>>>, ) -> Result<ResolvedSourceUnit, Diagnostic>
Attach the package’s UTF-8 attribution documents, shared across its modules.
§Errors
Rejects invalid or ambiguous names, invalid UTF-8, a repeated attachment, or input over the limit.
pub fn resolved_documents(&self) -> &BTreeMap<String, Arc<[u8]>>
pub fn resolved_documents(&self) -> &BTreeMap<String, Arc<[u8]>>
Attribution document names and immutable UTF-8 payloads of the owning package.
pub fn from_module(
namespace: CompilationNamespaceId,
file: impl Into<String>,
module: Module,
) -> Result<ResolvedSourceUnit, Diagnostic>
pub fn from_module( namespace: CompilationNamespaceId, file: impl Into<String>, module: Module, ) -> Result<ResolvedSourceUnit, Diagnostic>
Create a source unit from a directly authored module, with the same path and package identity rules as a parsed source unit. Compilation consumes the AST; it is formatted as text only when a consumer asks for text.
§Errors
Rejects invalid paths and the existing compiler AST/source resource limits.
pub const fn namespace(&self) -> &CompilationNamespaceId
pub const fn namespace(&self) -> &CompilationNamespaceId
Owning package namespace.
pub fn module_segments(&self) -> &[String]
pub fn module_segments(&self) -> &[String]
Path-derived logical module segments below the source root.
pub fn import_path(&self) -> String
pub fn import_path(&self) -> String
Import path as written in source. The owning package is given by
Self::namespace.
pub fn file(&self) -> &str
pub fn file(&self) -> &str
File path recorded for provenance, as supplied by the source bundle.
pub fn source(&self) -> Cow<'_, str>
pub fn source(&self) -> Cow<'_, str>
The original UTF-8 source or, for a directly authored module, its formatted canonical text.
pub const fn input_bytes(&self) -> usize
pub const fn input_bytes(&self) -> usize
Input size used for resource limits: UTF-8 bytes for parsed text, or canonical structural bytes for a native AST. Both are subject to the compiler’s AST limits.
pub fn diagnostic_file(&self) -> String
pub fn diagnostic_file(&self) -> String
Package-qualified source label used by compiler diagnostics.
The host-assigned module identity participates in the label.
Trait Implementations§
§impl Clone for ResolvedSourceUnit
impl Clone for ResolvedSourceUnit
§impl Debug for ResolvedSourceUnit
impl Debug for ResolvedSourceUnit
§impl PartialEq for ResolvedSourceUnit
impl PartialEq for ResolvedSourceUnit
§fn eq(&self, other: &ResolvedSourceUnit) -> bool
fn eq(&self, other: &ResolvedSourceUnit) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ResolvedSourceUnit
Auto Trait Implementations§
impl Freeze for ResolvedSourceUnit
impl RefUnwindSafe for ResolvedSourceUnit
impl Send for ResolvedSourceUnit
impl Sync for ResolvedSourceUnit
impl Unpin for ResolvedSourceUnit
impl UnsafeUnpin for ResolvedSourceUnit
impl UnwindSafe for ResolvedSourceUnit
Blanket Implementations§
Source§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Source§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
§fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
fn into_as<Dst>(self) -> Dstwhere
Self: Sized + Into<Dst>,
§fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
fn try_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + TryInto<Dst>,
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> From<T> for T
impl<T> From<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>where
F: FnOnce(&Self) -> bool,
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Same for T
impl<T> Same for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.