pub struct Symbol {
pub file: &'static str,
pub line: u32,
pub column: u32,
pub module: &'static str,
pub ident: &'static str,
}Expand description
Represents the source location and identity of a static variable declared via
init_static!.
This struct captures compile-time metadata about where a static was defined, enabling meaningful error messages and debugging output during initialization.
§Example
use init_static::Symbol;
let symbol: &Symbol = Symbol!(MY_VALUE);
println!("{symbol}"); // MY_VALUE (at src/main.rs:10:1)Fields§
§file: &'static strThe source file path where this static is declared.
See also: file!
line: u32The line number of the declaration.
See also: line!
column: u32The column number of the declaration.
See also: column!
module: &'static strThe full module path containing this static.
See also: module_path!
ident: &'static strThe identifier name of the static variable.
Trait Implementations§
impl Eq for Symbol
impl StructuralPartialEq for Symbol
Auto Trait Implementations§
impl Freeze for Symbol
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnwindSafe for Symbol
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