Struct wdl_analysis::StructType
source · pub struct StructType { /* private fields */ }Expand description
Represents the type of a struct.
Implementations§
source§impl StructType
impl StructType
sourcepub fn new<N, T>(
name: impl Into<String>,
members: impl IntoIterator<Item = (N, T)>,
) -> Self
pub fn new<N, T>( name: impl Into<String>, members: impl IntoIterator<Item = (N, T)>, ) -> Self
Constructs a new struct type definition.
sourcepub fn from_ast_v1<F>(
types: &mut Types,
definition: &StructDefinition,
lookup: &F,
) -> Result<Self, Diagnostic>
pub fn from_ast_v1<F>( types: &mut Types, definition: &StructDefinition, lookup: &F, ) -> Result<Self, Diagnostic>
Creates a new struct type from an V1 AST representation of a struct definition.
The provided callback is used to look up type name references.
If the type could not created, an error with the relevant diagnostic is returned.
Trait Implementations§
source§impl Coercible for StructType
impl Coercible for StructType
source§fn is_coercible_to(&self, types: &Types, target: &Self) -> bool
fn is_coercible_to(&self, types: &Types, target: &Self) -> bool
Determines if the type is coercible to the target type.
source§impl Debug for StructType
impl Debug for StructType
source§impl Display for StructType
impl Display for StructType
source§impl From<StructType> for CompoundTypeDef
impl From<StructType> for CompoundTypeDef
source§fn from(value: StructType) -> Self
fn from(value: StructType) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StructType
impl RefUnwindSafe for StructType
impl Send for StructType
impl Sync for StructType
impl Unpin for StructType
impl UnwindSafe for StructType
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
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