pub struct OpLocation {
pub op_id: Cow<'static, str>,
pub operand_idx: Option<u32>,
pub attr_name: Option<Cow<'static, str>>,
pub graph_node: Option<u32>,
pub graph_value: Option<u32>,
pub path: Option<String>,
pub source_span: Option<[u32; 2]>,
}Expand description
Typed location of a diagnostic inside source, graph, or artifact state.
Fields§
§op_id: Cow<'static, str>Stable operation or pass identifier when available.
operand_idx: Option<u32>Zero-based operand index.
attr_name: Option<Cow<'static, str>>Attribute name.
graph_node: Option<u32>Typed graph node identity.
graph_value: Option<u32>Typed graph value identity.
path: Option<String>Canonical request, source, or artifact path.
source_span: Option<[u32; 2]>Byte span inside the source path.
Implementations§
Source§impl OpLocation
impl OpLocation
Sourcepub fn op(op_id: impl Into<Cow<'static, str>>) -> OpLocation
pub fn op(op_id: impl Into<Cow<'static, str>>) -> OpLocation
Build a location that identifies an operation or pass.
Sourcepub fn with_operand(self, index: u32) -> OpLocation
pub fn with_operand(self, index: u32) -> OpLocation
Attach a specific operand index.
Sourcepub fn with_attr(self, name: impl Into<Cow<'static, str>>) -> OpLocation
pub fn with_attr(self, name: impl Into<Cow<'static, str>>) -> OpLocation
Attach a specific attribute name.
Sourcepub const fn with_graph_node(self, node: u32) -> OpLocation
pub const fn with_graph_node(self, node: u32) -> OpLocation
Attach a typed graph node identity.
Sourcepub const fn with_graph_value(self, value: u32) -> OpLocation
pub const fn with_graph_value(self, value: u32) -> OpLocation
Attach a typed graph value identity.
Sourcepub fn with_path(self, path: impl Into<String>) -> OpLocation
pub fn with_path(self, path: impl Into<String>) -> OpLocation
Attach a canonical source or artifact path.
Trait Implementations§
Source§impl Clone for OpLocation
impl Clone for OpLocation
Source§fn clone(&self) -> OpLocation
fn clone(&self) -> OpLocation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OpLocation
impl Debug for OpLocation
Source§impl<'de> Deserialize<'de> for OpLocation
impl<'de> Deserialize<'de> for OpLocation
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OpLocation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OpLocation, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for OpLocation
Source§impl PartialEq for OpLocation
impl PartialEq for OpLocation
Source§impl Serialize for OpLocation
impl Serialize for OpLocation
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for OpLocation
Auto Trait Implementations§
impl Freeze for OpLocation
impl RefUnwindSafe for OpLocation
impl Send for OpLocation
impl Sync for OpLocation
impl Unpin for OpLocation
impl UnsafeUnpin for OpLocation
impl UnwindSafe for OpLocation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.