pub struct RawEntityRef<T: ?Sized, Metadata = ()> { /* private fields */ }Expand description
A RawEntityRef is an unsafe smart pointer type for IR entities allocated in a [Context].
Along with the type of entity referenced, it can be instantiated with extra metadata of any type. For example, UnsafeIntrusiveEntityRef stores an intrusive link in the entity metadata, so that the entity can be added to an intrusive linked list without the entity needing to know about the link - and without violating aliasing rules when navigating the list.
Unlike regular references, no reference to the underlying T is constructed until one is
needed, at which point the borrow (whether mutable or immutable) is dynamically checked to
ensure that it is valid according to Rust’s aliasing rules.
As a result, a RawEntityRef is not considered an alias, and it is possible to acquire a mutable reference to the underlying data even while other copies of the handle exist. Any attempt to construct invalid aliases (immutable reference while a mutable reference exists, or vice versa), will result in a runtime panic.
This is a tradeoff, as we do not get compile-time guarantees that such panics will not occur, but in exchange we get a much more flexible and powerful IR structure.
§SAFETY
Unlike most smart-pointer types, e.g. Rc, [RAwEntityRef] does not provide any protection
against the underlying allocation being deallocated (i.e. the arena it points into is dropped).
This is by design, as the type is meant to be stored in objects inside the arena, and
not dropped when the arena is dropped. This requires care when using it however, to ensure
that no RawEntityRef lives longer than the arena that allocated it.
For a safe entity reference, see EntityRef, which binds a RawEntityRef to the lifetime of the arena.
Implementations§
Source§impl<T: 'static> RawEntityRef<T, IntrusiveLink>
impl<T: 'static> RawEntityRef<T, IntrusiveLink>
Sourcepub fn new(value: T, arena: &Blink) -> Self
pub fn new(value: T, arena: &Blink) -> Self
Create a new UnsafeIntrusiveEntityRef by allocating value in arena
§SAFETY
This function has the same requirements around safety as RawEntityRef::new.
pub fn new_uninit(arena: &Blink) -> RawEntityRef<MaybeUninit<T>, IntrusiveLink>
Source§impl<T> RawEntityRef<T, IntrusiveLink>where
T: EntityWithParent,
impl<T> RawEntityRef<T, IntrusiveLink>where
T: EntityWithParent,
Sourcepub fn parent(
&self,
) -> Option<UnsafeIntrusiveEntityRef<<T as EntityWithParent>::Parent>>
pub fn parent( &self, ) -> Option<UnsafeIntrusiveEntityRef<<T as EntityWithParent>::Parent>>
Returns the parent entity this entity is linked to, if linked.
Source§impl<T> RawEntityRef<T, IntrusiveLink>
impl<T> RawEntityRef<T, IntrusiveLink>
pub fn grandparent( &self, ) -> Option<UnsafeIntrusiveEntityRef<<<T as EntityWithParent>::Parent as EntityWithParent>::Parent>>
Source§impl<T> RawEntityRef<T, IntrusiveLink>
impl<T> RawEntityRef<T, IntrusiveLink>
Source§impl<T: 'static, Metadata: 'static> RawEntityRef<T, Metadata>
impl<T: 'static, Metadata: 'static> RawEntityRef<T, Metadata>
Sourcepub fn new_with_metadata(value: T, metadata: Metadata, arena: &Blink) -> Self
pub fn new_with_metadata(value: T, metadata: Metadata, arena: &Blink) -> Self
Create a new RawEntityRef by allocating value with metadata in the given arena
allocator.
§SAFETY
The resulting RawEntityRef must not outlive the arena. This is not enforced statically, it is up to the caller to uphold the invariants of this type.
Sourcepub fn new_uninit_with_metadata(
metadata: Metadata,
arena: &Blink,
) -> RawEntityRef<MaybeUninit<T>, Metadata>
pub fn new_uninit_with_metadata( metadata: Metadata, arena: &Blink, ) -> RawEntityRef<MaybeUninit<T>, Metadata>
Create a RawEntityRef for an entity which may not be fully initialized, using the provided arena.
§SAFETY
The safety rules are much the same as RawEntityRef::new, with the main difference
being that the T does not have to be initialized yet. No references to the T will
be created directly until RawEntityRef::assume_init is called.
Source§impl<T: 'static> RawEntityRef<T, ()>
impl<T: 'static> RawEntityRef<T, ()>
pub fn new(value: T, arena: &Blink) -> Self
pub fn new_uninit(arena: &Blink) -> RawEntityRef<MaybeUninit<T>, ()>
Source§impl<T, Metadata> RawEntityRef<MaybeUninit<T>, Metadata>
impl<T, Metadata> RawEntityRef<MaybeUninit<T>, Metadata>
Sourcepub unsafe fn assume_init(self) -> RawEntityRef<T, Metadata>
pub unsafe fn assume_init(self) -> RawEntityRef<T, Metadata>
Converts to RawEntityRef<T>.
§Safety
Just like with MaybeUninit::assume_init, it is up to the caller to guarantee that the value really is in an initialized state. Calling this when the content is not yet fully initialized causes immediate undefined behavior.
Source§impl<T: ?Sized, Metadata> RawEntityRef<T, Metadata>
impl<T: ?Sized, Metadata> RawEntityRef<T, Metadata>
Sourcepub fn into_raw(this: Self) -> *const T
pub fn into_raw(this: Self) -> *const T
Convert this handle into a raw pointer to the underlying entity.
This should only be used in situations where the returned pointer will not be used to actually access the underlying entity. Use [get] or [get_mut] for that. RawEntityRef ensures that Rust’s aliasing rules are not violated when using it, but if you use the returned pointer to do so, no such guarantee is provided, and undefined behavior can result.
§Safety
The returned pointer must not be used to create a reference to the underlying entity unless you can guarantee that such a reference does not violate Rust’s aliasing rules.
Do not use the pointer to create a mutable reference if other references exist, and do not use the pointer to create an immutable reference if a mutable reference exists or might be created while the immutable reference lives.
pub fn as_ptr(this: &Self) -> *const T
Sourcepub unsafe fn from_raw(ptr: *const T) -> Self
pub unsafe fn from_raw(ptr: *const T) -> Self
Convert a pointer returned by RawEntityRef::into_raw back into a RawEntityRef.
§Safety
- It is only valid to call this method on a pointer returned by RawEntityRef::into_raw.
- The pointer must be a valid pointer for
T
Sourcepub fn borrow<'a, 'b: 'a>(&'a self) -> EntityRef<'b, T>
pub fn borrow<'a, 'b: 'a>(&'a self) -> EntityRef<'b, T>
Get a dynamically-checked immutable reference to the underlying T
Sourcepub fn borrow_mut<'a, 'b: 'a>(&'a mut self) -> EntityMut<'b, T>
pub fn borrow_mut<'a, 'b: 'a>(&'a mut self) -> EntityMut<'b, T>
Get a dynamically-checked mutable reference to the underlying T
Sourcepub fn try_borrow_mut<'a, 'b: 'a>(&'a mut self) -> Option<EntityMut<'b, T>>
pub fn try_borrow_mut<'a, 'b: 'a>(&'a mut self) -> Option<EntityMut<'b, T>>
Try to get a dynamically-checked mutable reference to the underlying T
Returns None if the entity is already borrowed
pub fn ptr_eq(this: &Self, other: &Self) -> bool
Source§impl<From: ?Sized, Metadata: 'static> RawEntityRef<From, Metadata>
impl<From: ?Sized, Metadata: 'static> RawEntityRef<From, Metadata>
Sourcepub fn try_downcast<To>(
self,
) -> Result<RawEntityRef<To, Metadata>, RawEntityRef<From, Metadata>>where
To: DowncastFromRef<From> + 'static,
From: 'static,
pub fn try_downcast<To>(
self,
) -> Result<RawEntityRef<To, Metadata>, RawEntityRef<From, Metadata>>where
To: DowncastFromRef<From> + 'static,
From: 'static,
Casts this reference to the concrete type T, if the underlying value is a T.
If the cast is not valid for this reference, Err is returned containing the original value.
Sourcepub fn try_downcast_ref<To, Obj>(&self) -> Option<RawEntityRef<To, Metadata>>where
To: DowncastFromRef<From> + 'static,
From: Is<Obj> + AsAny + 'static,
Obj: ?Sized,
pub fn try_downcast_ref<To, Obj>(&self) -> Option<RawEntityRef<To, Metadata>>where
To: DowncastFromRef<From> + 'static,
From: Is<Obj> + AsAny + 'static,
Obj: ?Sized,
Casts this reference to the concrete type T, if the underlying value is a T.
If the cast is not valid for this reference, Err is returned containing the original value.
Sourcepub fn downcast<To, Obj>(self) -> RawEntityRef<To, Metadata>where
To: DowncastFromRef<From> + 'static,
From: Is<Obj> + AsAny + 'static,
Obj: ?Sized,
pub fn downcast<To, Obj>(self) -> RawEntityRef<To, Metadata>where
To: DowncastFromRef<From> + 'static,
From: Is<Obj> + AsAny + 'static,
Obj: ?Sized,
Casts this reference to the concrete type T, if the underlying value is a T.
Panics if the cast is not valid for this reference.
Sourcepub fn downcast_ref<To, Obj>(&self) -> RawEntityRef<To, Metadata>where
To: DowncastFromRef<From> + 'static,
From: Is<Obj> + AsAny + 'static,
Obj: ?Sized,
pub fn downcast_ref<To, Obj>(&self) -> RawEntityRef<To, Metadata>where
To: DowncastFromRef<From> + 'static,
From: Is<Obj> + AsAny + 'static,
Obj: ?Sized,
Casts this reference to the concrete type T, if the underlying value is a T.
Panics if the cast is not valid for this reference.
Source§impl<To, Metadata: 'static> RawEntityRef<To, Metadata>
impl<To, Metadata: 'static> RawEntityRef<To, Metadata>
pub fn try_downcast_from<From>(
from: RawEntityRef<From, Metadata>,
) -> Result<Self, RawEntityRef<From, Metadata>>where
From: ?Sized + 'static,
To: DowncastFromRef<From> + 'static,
pub fn try_downcast_from_ref<From, Obj>( from: &RawEntityRef<From, Metadata>, ) -> Option<Self>
pub fn downcast_from<From, Obj>(from: RawEntityRef<From, Metadata>) -> Self
pub fn downcast_from_ref<From, Obj>(from: &RawEntityRef<From, Metadata>) -> Self
Source§impl<From: ?Sized, Metadata: 'static> RawEntityRef<From, Metadata>
impl<From: ?Sized, Metadata: 'static> RawEntityRef<From, Metadata>
Sourcepub fn upcast<To>(self) -> RawEntityRef<To, Metadata>
pub fn upcast<To>(self) -> RawEntityRef<To, Metadata>
Casts this reference to the an unsized type Trait, if From implements Trait
If the cast is not valid for this reference, Err is returned containing the original value.
Source§impl<T: Op> RawEntityRef<T, IntrusiveLink>
impl<T: Op> RawEntityRef<T, IntrusiveLink>
Sourcepub fn as_operation_ref(self) -> OperationRef
pub fn as_operation_ref(self) -> OperationRef
Get a entity ref for the underlying crate::Operation data of an [Op].
Source§impl RawEntityRef<Operation, IntrusiveLink>
Insertion
impl RawEntityRef<Operation, IntrusiveLink>
Insertion
pub fn insert_at_start(self, block: BlockRef)
pub fn insert_at_end(self, block: BlockRef)
pub fn insert_before(self, before: OperationRef)
pub fn insert_after(self, after: OperationRef)
Source§impl RawEntityRef<Operation, IntrusiveLink>
Read-only Metadata
impl RawEntityRef<Operation, IntrusiveLink>
Read-only Metadata
pub fn name(&self) -> OperationName
Sourcepub fn parent_op(&self) -> Option<OperationRef>
pub fn parent_op(&self) -> Option<OperationRef>
Returns a handle to the nearest containing Operation of this operation, if it is attached to one
Sourcepub fn parent_region(&self) -> Option<RegionRef>
pub fn parent_region(&self) -> Option<RegionRef>
Returns a handle to the containing Region of this operation, if it is attached to one
Sourcepub fn nearest_symbol_table(&self) -> Option<OperationRef>
pub fn nearest_symbol_table(&self) -> Option<OperationRef>
Returns the nearest SymbolTable from this operation.
Returns None if no parent of this operation is a valid symbol table.
Trait Implementations§
Source§impl Borrow<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for &ValueOrAlias
impl Borrow<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for &ValueOrAlias
Source§impl Borrow<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for &mut ValueOrAlias
impl Borrow<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for &mut ValueOrAlias
Source§impl Borrow<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for ValueOrAlias
impl Borrow<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for ValueOrAlias
Source§impl<T: ?Sized, Metadata> Clone for RawEntityRef<T, Metadata>
impl<T: ?Sized, Metadata> Clone for RawEntityRef<T, Metadata>
Source§impl<T: ?Sized + Debug + EntityWithId, Metadata> Debug for RawEntityRef<T, Metadata>
impl<T: ?Sized + Debug + EntityWithId, Metadata> Debug for RawEntityRef<T, Metadata>
Source§impl<T: ?Sized + Display + EntityWithId, Metadata> Display for RawEntityRef<T, Metadata>
impl<T: ?Sized + Display + EntityWithId, Metadata> Display for RawEntityRef<T, Metadata>
Source§impl From<RawEntityRef<Block, IntrusiveLink>> for ProgramPoint
Construct a ProgramPoint referring to the point at entry to block
impl From<RawEntityRef<Block, IntrusiveLink>> for ProgramPoint
Construct a ProgramPoint referring to the point at entry to block
Source§impl From<RawEntityRef<Operation, IntrusiveLink>> for ProgramPoint
Construct a ProgramPoint referring to the point at entry to op
impl From<RawEntityRef<Operation, IntrusiveLink>> for ProgramPoint
Construct a ProgramPoint referring to the point at entry to op
Source§fn from(op: OperationRef) -> Self
fn from(op: OperationRef) -> Self
Source§impl From<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for Callable
impl From<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for Callable
Source§impl From<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for ValueOrAlias
impl From<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for ValueOrAlias
Source§impl<const N: usize> FromIterator<RawEntityRef<BlockArgument>> for ValueRange<'static, N>
impl<const N: usize> FromIterator<RawEntityRef<BlockArgument>> for ValueRange<'static, N>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = BlockArgumentRef>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = BlockArgumentRef>,
Source§impl<const N: usize> FromIterator<RawEntityRef<OpOperandImpl, IntrusiveLink>> for ValueRange<'static, N>
impl<const N: usize> FromIterator<RawEntityRef<OpOperandImpl, IntrusiveLink>> for ValueRange<'static, N>
Source§impl<const N: usize> FromIterator<RawEntityRef<OpResult>> for ValueRange<'static, N>
impl<const N: usize> FromIterator<RawEntityRef<OpResult>> for ValueRange<'static, N>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = OpResultRef>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = OpResultRef>,
Source§impl FromIterator<RawEntityRef<SymbolUse, IntrusiveLink>> for SymbolUseRefsIter
impl FromIterator<RawEntityRef<SymbolUse, IntrusiveLink>> for SymbolUseRefsIter
Source§fn from_iter<T: IntoIterator<Item = SymbolUseRef>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = SymbolUseRef>>(iter: T) -> Self
Source§impl FromIterator<RawEntityRef<SymbolUse, IntrusiveLink>> for SymbolUsesIter
impl FromIterator<RawEntityRef<SymbolUse, IntrusiveLink>> for SymbolUsesIter
Source§fn from_iter<T: IntoIterator<Item = SymbolUseRef>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = SymbolUseRef>>(iter: T) -> Self
Source§impl<T: EntityListItem> FromIterator<RawEntityRef<T, IntrusiveLink>> for EntityList<T>
impl<T: EntityListItem> FromIterator<RawEntityRef<T, IntrusiveLink>> for EntityList<T>
Source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = UnsafeIntrusiveEntityRef<T>>,
fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = UnsafeIntrusiveEntityRef<T>>,
Source§impl<const N: usize> FromIterator<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for ValueRange<'static, N>
impl<const N: usize> FromIterator<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for ValueRange<'static, N>
Source§impl<T: ?Sized, Metadata> Hash for RawEntityRef<T, Metadata>
impl<T: ?Sized, Metadata> Hash for RawEntityRef<T, Metadata>
Source§impl<T: ?Sized + EntityWithId, Metadata> Ord for RawEntityRef<T, Metadata>
impl<T: ?Sized + EntityWithId, Metadata> Ord for RawEntityRef<T, Metadata>
Source§impl PartialEq<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for ValueOrAlias
impl PartialEq<RawEntityRef<dyn Value<Id = ValueId, Use = OpOperandImpl>>> for ValueOrAlias
Source§impl<T: ?Sized, Metadata> PartialEq for RawEntityRef<T, Metadata>
impl<T: ?Sized, Metadata> PartialEq for RawEntityRef<T, Metadata>
Source§impl<T: ?Sized + EntityWithId, Metadata> PartialOrd for RawEntityRef<T, Metadata>
impl<T: ?Sized + EntityWithId, Metadata> PartialOrd for RawEntityRef<T, Metadata>
Source§impl<T: ?Sized, Metadata> Pointer for RawEntityRef<T, Metadata>
impl<T: ?Sized, Metadata> Pointer for RawEntityRef<T, Metadata>
Source§impl<T: ?Sized + PrettyPrint, Metadata> PrettyPrint for RawEntityRef<T, Metadata>
impl<T: ?Sized + PrettyPrint, Metadata> PrettyPrint for RawEntityRef<T, Metadata>
Source§fn to_pretty_string(&self) -> String
fn to_pretty_string(&self) -> String
Source§fn pretty_print(&self, f: &mut Formatter<'_>) -> Result<(), Error>
fn pretty_print(&self, f: &mut Formatter<'_>) -> Result<(), Error>
Source§impl<T: ?Sized + Spanned, Metadata> Spanned for RawEntityRef<T, Metadata>
impl<T: ?Sized + Spanned, Metadata> Spanned for RawEntityRef<T, Metadata>
fn span(&self) -> SourceSpan
Source§impl<T: ?Sized + StorableEntity, Metadata> StorableEntity for RawEntityRef<T, Metadata>
impl<T: ?Sized + StorableEntity, Metadata> StorableEntity for RawEntityRef<T, Metadata>
impl<T, U, Metadata> CoerceUnsized<RawEntityRef<U, Metadata>> for RawEntityRef<T, Metadata>
impl<T: ?Sized, Metadata> Copy for RawEntityRef<T, Metadata>
impl<T: ?Sized, Metadata> Eq for RawEntityRef<T, Metadata>
Auto Trait Implementations§
impl<T, Metadata> Freeze for RawEntityRef<T, Metadata>where
T: ?Sized,
impl<T, Metadata = ()> !RefUnwindSafe for RawEntityRef<T, Metadata>
impl<T, Metadata = ()> !Send for RawEntityRef<T, Metadata>
impl<T, Metadata = ()> !Sync for RawEntityRef<T, Metadata>
impl<T, Metadata> Unpin for RawEntityRef<T, Metadata>where
T: ?Sized,
impl<T, Metadata = ()> !UnwindSafe for RawEntityRef<T, Metadata>
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<T> DynPartialEq for Twhere
T: PartialEq + 'static,
impl<T> DynPartialEq for Twhere
T: PartialEq + 'static,
default fn dyn_eq(&self, rhs: &(dyn DynPartialEq + 'static)) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Source§impl<T> PassTarget for Twhere
T: 'static,
impl<T> PassTarget for Twhere
T: 'static,
default fn target_name(_context: &Context) -> Option<OperationName>
default fn into_target( op: &RawEntityRef<Operation, IntrusiveLink>, ) -> EntityRef<'_, T>
default fn into_target_mut( op: &mut RawEntityRef<Operation, IntrusiveLink>, ) -> EntityMut<'_, T>
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T, Trait> Verifier<Trait> for Twhere
Trait: ?Sized,
impl<T, Trait> Verifier<Trait> for Twhere
Trait: ?Sized,
Source§const VACUOUS: bool = true
const VACUOUS: bool = true
Verifier sets this flag to true when its implementation is vacuous,
i.e. it always succeeds and is not dependent on runtime context. Read moreSource§default fn should_verify(&self, _context: &Context) -> bool
default fn should_verify(&self, _context: &Context) -> bool
Source§default fn maybe_verify(&self, _context: &Context) -> Result<(), Report>
default fn maybe_verify(&self, _context: &Context) -> Result<(), Report>
true