Skip to main content

Columns

Struct Columns 

Source
pub struct Columns<'a> {
    pub skip: usize,
    pub pwd: &'a str,
    pub funcs: &'a str,
    pub sources: &'a str,
    pub lines: &'a str,
    pub args: Option<Args<'a>>,
}
Expand description

One frame walk, in the sections stack.bash writes.

Fields§

§skip: usize

How many leading frames belong to the instrument rather than the subject. At least one — the emitter’s own.

§pwd: &'a str

The sending shell’s $PWD, which a relative BASH_SOURCE is relative to as far as anything can know.

§funcs: &'a str§sources: &'a str§lines: &'a str§args: Option<Args<'a>>

Absent where an instrument does not report arguments at all.

Implementations§

Source§

impl<'a> Columns<'a>

Source

pub fn of(words: &'a [String]) -> Result<Self, Failure>

The sections out of a message’s key value payload, which is the shape stack.bash appends them in.

Source

pub fn frames(&self, shell: &Shell) -> Result<Stack, Failure>

The subject’s walk, read against the shell it was taken in.

shell is what that shell said of itself when it joined, and it is needed because BASH_SOURCE alone cannot say what its own words mean: $0 is a path in one shell and a stand-in for code in another.

Auto Trait Implementations§

§

impl<'a> Freeze for Columns<'a>

§

impl<'a> RefUnwindSafe for Columns<'a>

§

impl<'a> Send for Columns<'a>

§

impl<'a> Sync for Columns<'a>

§

impl<'a> Unpin for Columns<'a>

§

impl<'a> UnsafeUnpin for Columns<'a>

§

impl<'a> UnwindSafe for Columns<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.