doc.rust-lang.org
pub fn location(&self) -> Option<&'static Location<'static>>
Returns information about the location from which the panic originated, if available.
method
core
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct PanicInfo<'a>
A struct providing information about a panic.
struct
core
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn line(&self) -> u32
Returns the line number from which the panic originated.
method
core
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn file_as_c_str(&self) -> &'a CStr
Returns the name of the source file as a nul-terminated CStr.
method
core
Stable since 1.92.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn file(&self) -> &'a str
Returns the name of the source file from which the panic originated.
method
core
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn column(&self) -> u32
Returns the column from which the panic originated.
method
core
Stable since 1.25.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn caller() -> &'static Location<'static>
Returns the source location of the caller of this function. If that function's caller is annotated then its call location will be returned, and so on up the stack to the first call within a non-tracked function body.
associated_function
core
Stable since 1.46.0
Version 1.100.0-nightly
doc.rust-lang.org
pub struct Location<'a>
A struct containing information about the location of a panic.
struct
core
Stable since 1.10.0
Version 1.100.0-nightly
doc.rust-lang.org
pub mod panic
Panic support in core.
module
core
Stable since 1.41.0
Version 1.100.0-nightly
doc.rust-lang.org
pub macro panic!
Panics the current thread.
macro
core
Stable since 1.6.0
Version 1.100.0-nightly
doc.rust-lang.org
pub macro option_env!
Optionally inspects an environment variable at compile time.
macro
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn zip<U>(self, other: Option<U>) -> Option<(T, U)>
Makes a tuple of the value in self and the value in another Option.
method
core
Stable since 1.46.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn xor(self, optb: Option<T>) -> Option<T>
Returns Some if exactly one of self, optb is Some, otherwise returns None.
method
core
Stable since 1.37.0
Version 1.100.0-nightly
doc.rust-lang.org
pub fn unzip(self) -> (Option<T>, Option<U>)
Unzips an option containing a tuple of two options.
method
core
Stable since 1.66.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const unsafe fn unwrap_unchecked(self) -> T
Returns the contained Some value, consuming the self value, without checking that the value is not None.
method
core
Stable since 1.58.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn unwrap_or_else<F>(self, f: F) -> T
Returns the contained Some value or computes it from a closure.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn unwrap_or_default(self) -> T
Returns the contained Some value or a default.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn unwrap_or(self, default: T) -> T
Returns the contained Some value or a provided default.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn unwrap(self) -> T
Returns the contained Some value, consuming the self value.
method
core
Stable since 1.0.0
Version 1.100.0-nightly
doc.rust-lang.org
pub const fn transpose(self) -> Result<Option<T>, E>
Transposes an Option of a Result into a Result of an Option.
method
core
Stable since 1.33.0
Version 1.100.0-nightly