pub struct Source {
pub name: Option<String>,
pub path: Option<String>,
pub source_reference: Option<i64>,
pub origin: Option<String>,
pub presentation_hint: Option<SourcePresentationHint>,
}Expand description
Represents a source file in the debugging context.
Fields§
§name: Option<String>The short name of the source file
path: Option<String>The full path to the source file
source_reference: Option<i64>A reference ID for retrieving source content dynamically
origin: Option<String>The origin of the source (e.g., “eval”, “require”)
presentation_hint: Option<SourcePresentationHint>Presentation hint for the source
Implementations§
Source§impl Source
impl Source
Sourcepub fn from_reference(reference: i64, name: impl Into<String>) -> Self
pub fn from_reference(reference: i64, name: impl Into<String>) -> Self
Creates a source with a dynamic reference (no file path).
Sourcepub fn with_origin(self, origin: impl Into<String>) -> Self
pub fn with_origin(self, origin: impl Into<String>) -> Self
Sets the origin for this source.
Sourcepub fn with_presentation_hint(self, hint: SourcePresentationHint) -> Self
pub fn with_presentation_hint(self, hint: SourcePresentationHint) -> Self
Sets the presentation hint.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
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