Struct QuoteSheet
pub struct QuoteSheet {
entries: Vec<SheetEntry>,
}Expand description
A quote sheet as a desk reads it: entries in sheet order, each a template, a locator and a value. The sheet is the grid — a recipe says which templates build the curve, and the sheet says where.
Fields§
§entries: Vec<SheetEntry>Implementations§
§impl QuoteSheet
impl QuoteSheet
pub fn new() -> Self
pub fn new() -> Self
An empty sheet.
pub fn with(self, template: &str, locator: Locator, value: f64) -> Self
pub fn with(self, template: &str, locator: Locator, value: f64) -> Self
This sheet with (template, locator, value) appended.
pub fn push(&mut self, template: &str, locator: Locator, value: f64)
pub fn push(&mut self, template: &str, locator: Locator, value: f64)
Appends (template, locator, value).
pub fn with_spelled(
self,
template: &str,
spelling: &str,
value: f64,
) -> Result<Self, RungBuildError>
pub fn with_spelled( self, template: &str, spelling: &str, value: f64, ) -> Result<Self, RungBuildError>
This sheet with an entry whose locator is parsed from spelling.
§Errors
RungBuildError for a spelling that
is none of the locator shapes.
pub fn from_rows<'a>(
rows: impl IntoIterator<Item = (&'a str, &'a str, f64)>,
) -> Result<Self, RungBuildError>
pub fn from_rows<'a>( rows: impl IntoIterator<Item = (&'a str, &'a str, f64)>, ) -> Result<Self, RungBuildError>
A sheet from (template, spelling, quote) rows, in order, each
spelling parsed as with_spelled parses it — the
Rust spelling of the nested quote dictionary Python passes.
§Errors
The first row whose spelling is none of the locator shapes, as
with_spelled refuses it.
pub fn entries(&self) -> &[SheetEntry]
pub fn entries(&self) -> &[SheetEntry]
The entries in sheet order.
Trait Implementations§
§impl Clone for QuoteSheet
impl Clone for QuoteSheet
§fn clone(&self) -> QuoteSheet
fn clone(&self) -> QuoteSheet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for QuoteSheet
impl Debug for QuoteSheet
§impl Default for QuoteSheet
impl Default for QuoteSheet
§fn default() -> QuoteSheet
fn default() -> QuoteSheet
Returns the “default value” for a type. Read more
§impl PartialEq for QuoteSheet
impl PartialEq for QuoteSheet
impl StructuralPartialEq for QuoteSheet
Auto Trait Implementations§
impl Freeze for QuoteSheet
impl RefUnwindSafe for QuoteSheet
impl Send for QuoteSheet
impl Sync for QuoteSheet
impl Unpin for QuoteSheet
impl UnsafeUnpin for QuoteSheet
impl UnwindSafe for QuoteSheet
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