pub struct TypeOperation<'c> { /* private fields */ }
Expand description
A type
operation. Define a type handle within a pattern.
pdl.type
operations capture result type constraints of Attributes
,
Values
, and Operations
. Instances of this operation define, and
partially constrain, results types of a given entity. A pdl.type
may
partially constrain the result by specifying a constant Type
.
Example:
// Define a type:
%type = pdl.type
// Define a type with a constant value:
%type = pdl.type : i32
Implementations§
source§impl<'c> TypeOperation<'c>
impl<'c> TypeOperation<'c>
sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
sourcepub fn builder(
context: &'c Context,
location: Location<'c>
) -> TypeOperationBuilder<'c, Unset>
pub fn builder( context: &'c Context, location: Location<'c> ) -> TypeOperationBuilder<'c, Unset>
Creates a builder.
pub fn result(&self) -> Result<OperationResult<'c, '_>, Error>
pub fn constant_type(&self) -> Result<TypeAttribute<'c>, Error>
pub fn set_constant_type(&mut self, value: TypeAttribute<'c>)
pub fn remove_constant_type(&mut self) -> Result<(), Error>
Trait Implementations§
source§impl<'c> From<TypeOperation<'c>> for Operation<'c>
impl<'c> From<TypeOperation<'c>> for Operation<'c>
source§fn from(operation: TypeOperation<'c>) -> Self
fn from(operation: TypeOperation<'c>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'c> RefUnwindSafe for TypeOperation<'c>
impl<'c> !Send for TypeOperation<'c>
impl<'c> !Sync for TypeOperation<'c>
impl<'c> Unpin for TypeOperation<'c>
impl<'c> UnwindSafe for TypeOperation<'c>
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