Enum zaplib::CodeFragment
[−]pub enum CodeFragment {
Static {
filename: &'static str,
line: usize,
col: usize,
code: &'static str,
},
Dynamic {
name: String,
code: String,
},
}
Expand description
Represents a location in a file, and the code string itself. Generate easily
using the zaplib::code_fragment!()
macro.
Variants
Static
Dynamic
Implementations
impl CodeFragment
impl CodeFragment
pub fn name_line_col_at_offset(&self, offset_chars: usize) -> String
pub fn name_line_col_at_offset(&self, offset_chars: usize) -> String
Offset the line
and col
fields by a certain number of characters.
Trait Implementations
impl Clone for CodeFragment
impl Clone for CodeFragment
pub fn clone(&self) -> CodeFragment
pub fn clone(&self) -> CodeFragment
Returns a copy of the value. Read more
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for CodeFragment
impl Send for CodeFragment
impl Sync for CodeFragment
impl Unpin for CodeFragment
impl UnwindSafe for CodeFragment
Blanket Implementations
Mutably borrows from an owned value. Read more