pub struct ParsedModule<I, Ty, H> {
pub header: H,
pub functions: Vec<ParsedFunction<I, Ty>>,
}Expand description
Parsed SST module containing consumer instruction values.
I is the consumer’s instruction syntax type, Ty is its source type
syntax, and H is its section-header type.
Fields§
§header: H§functions: Vec<ParsedFunction<I, Ty>>Implementations§
Source§impl<I, Ty: PartialEq, H> ParsedModule<I, Ty, H>
impl<I, Ty: PartialEq, H> ParsedModule<I, Ty, H>
Sourcepub fn lower_with_metadata<C, Info>(
self,
metadata: ProgramMetadata<Value, Ty, Info>,
context: &mut C,
) -> Result<LocalModule<I::Runtime, Value, Ty, Info>>where
I: Lower<C>,
C: FunctionScope,
pub fn lower_with_metadata<C, Info>(
self,
metadata: ProgramMetadata<Value, Ty, Info>,
context: &mut C,
) -> Result<LocalModule<I::Runtime, Value, Ty, Info>>where
I: Lower<C>,
C: FunctionScope,
Validate declarations and tables, lower instructions with the supplied context, and assemble a module without inventing or reordering metadata.
The consumer extracts the metadata from its chosen header schema and
prepares section-wide context capabilities before calling this method.
lower_functions prepares function-local scopes. Standard CPU symbol
capabilities are provided by MetadataLoweringContext in vihaco-module.
Additional capabilities can be supplied by a consumer-owned context.
The header itself is not interpreted by this method.
§Errors
Returns declaration, table, or lowering errors. Context mutations before an error are retained; no partial module is returned.
Source§impl<I, Ty: PartialEq, H> ParsedModule<I, Ty, H>
impl<I, Ty: PartialEq, H> ParsedModule<I, Ty, H>
Sourcepub fn validate_metadata<V, Info>(
&self,
metadata: &ProgramMetadata<V, Ty, Info>,
) -> Result<()>
pub fn validate_metadata<V, Info>( &self, metadata: &ProgramMetadata<V, Ty, Info>, ) -> Result<()>
Check fn declarations against supplied metadata without changing either.
Table bounds and runtime constant references are checked during assembly.
Source§impl<I, Ty, H> ParsedModule<I, Ty, H>
impl<I, Ty, H> ParsedModule<I, Ty, H>
Sourcepub fn parse_section<'src, C>(section: SstSectionView<'src, C>) -> Result<Self>
pub fn parse_section<'src, C>(section: SstSectionView<'src, C>) -> Result<Self>
Parse a source section into its consumer instruction representation.
Trait Implementations§
Source§impl<I: Clone, Ty: Clone, H: Clone> Clone for ParsedModule<I, Ty, H>
impl<I: Clone, Ty: Clone, H: Clone> Clone for ParsedModule<I, Ty, H>
Source§fn clone(&self) -> ParsedModule<I, Ty, H>
fn clone(&self) -> ParsedModule<I, Ty, H>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<I: PartialEq, Ty: PartialEq, H: PartialEq> StructuralPartialEq for ParsedModule<I, Ty, H>
Auto Trait Implementations§
impl<I, Ty, H> Freeze for ParsedModule<I, Ty, H>where
H: Freeze,
impl<I, Ty, H> RefUnwindSafe for ParsedModule<I, Ty, H>
impl<I, Ty, H> Send for ParsedModule<I, Ty, H>
impl<I, Ty, H> Sync for ParsedModule<I, Ty, H>
impl<I, Ty, H> Unpin for ParsedModule<I, Ty, H>
impl<I, Ty, H> UnsafeUnpin for ParsedModule<I, Ty, H>where
H: UnsafeUnpin,
impl<I, Ty, H> UnwindSafe for ParsedModule<I, Ty, H>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<'src, T> IntoMaybe<'src, T> for Twhere
T: 'src,
impl<T> OrderedSeq<'_, T> for Twhere
T: Clone,
§impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
impl<'p, T> Seq<'p, T> for Twhere
T: Clone,
§type Iter<'a> = Once<&'a T>
where
T: 'a
type Iter<'a> = Once<&'a T> where T: 'a
§fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
fn contains(&self, val: &T) -> boolwhere
T: PartialEq,
§fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
fn to_maybe_ref<'b>(item: <T as Seq<'p, T>>::Item<'b>) -> Maybe<T, &'p T>where
'p: 'b,
MaybeRef].