historian v0.11.0-beta.2 Historian.History View Source
A data structure for managing histories.
Link to this section Summary
Functions
Returns a line from the history buffer by it's index.
Pluck takes a list of line ids returning an updated history buffer containing only lines coresponding to the ids.
Pluck takes a list of line numbers returning a list containing only lines coresponding to the matching ids (or an empty list if there are no matches).
Search the history buffer's values matching the pattern, and return an updated History buffer containing only the matching items.
Search the history buffer's values matching the pattern, and return only the matching items.
Slice the history buffer's using the given bounds, and return a list containing only the sliced items.
Slice the history buffer's using the given bounds, and return an updated buffer containing only the sliced items.
Link to this section Types
Link to this section Functions
create(lines, name \\ :default)
View Sourcecreate([{iolist(), non_neg_integer()}], atom()) :: t(Historian.History.Item.t())
line_at(map, index)
View Sourceline_at(history :: t(Historian.History.Item.t()), index :: non_neg_integer()) :: Historian.History.Item.t() | nil
Returns a line from the history buffer by it's index.
Pluck takes a list of line ids returning an updated history buffer containing only lines coresponding to the ids.
pluck!(history, line_numbers)
View Sourcepluck!( history :: t(Historian.History.Item.t()), line_numbers :: [non_neg_integer()] ) :: [Historian.History.Item.t()]
pluck!( history :: t(Historian.History.Item.t()), line_number :: non_neg_integer() ) :: t(Historian.History.Item.t())
Pluck takes a list of line numbers returning a list containing only lines coresponding to the matching ids (or an empty list if there are no matches).
search(history, pattern)
View Sourcesearch(history :: t(Historian.History.Item.t()), pattern :: Regex.t()) :: t(Historian.History.Item.t())
Search the history buffer's values matching the pattern, and return an updated History buffer containing only the matching items.
search!(history, pattern)
View Sourcesearch!(history :: t(Historian.History.Item.t()), pattern :: Regex.t()) :: [ Historian.History.Item.t() ]
Search the history buffer's values matching the pattern, and return only the matching items.
slice(history, start, stop)
View Sourceslice( history :: t(Historian.History.Item.t()), start :: non_neg_integer(), stop :: integer() ) :: t(Historian.History.Item.t())
Slice the history buffer's using the given bounds, and return a list containing only the sliced items.
slice!(history, start, stop)
View Sourceslice!( history :: t(Historian.History.Item.t()), start :: non_neg_integer(), stop :: integer() ) :: [Historian.History.Item.t()]
Slice the history buffer's using the given bounds, and return an updated buffer containing only the sliced items.