pub struct Alignment {
pub is_halign: bool,
pub head_rows: Vec<Row>,
pub foot_rows: Vec<Row>,
/* private fields */
}Fields§
§is_halign: boolTrue for \halign templates
head_rows: Vec<Row>§foot_rows: Vec<Row>Implementations§
Source§impl Alignment
impl Alignment
Sourcepub fn new(config: AlignmentConfig) -> Self
pub fn new(config: AlignmentConfig) -> Self
Create a new Alignment.
config can contain:
- template: an Alignment::Template object
- openContainer: creates the container element with given attributes
- closeContainer = sub($doc); closes the container
- openRow = sub($doc,%attrib); creates the row element with given attributes
- closeRow = closes the row
- openColumn = sub($doc,%attrib); creates the column element with given attributes
- closeColumn = closes the column
- properties = hashmap containing extra attributes for the container element.
- xml_attributes = hashmap containing attributes for the main XML node
pub fn get_template(&self) -> &Template
pub fn current_row(&self) -> Option<&Row>
pub fn current_row_mut(&mut self) -> Option<&mut Row>
pub fn new_row(&mut self) -> Option<&Row>
pub fn remove_row(&mut self) -> Option<Row>
pub fn prepend_rows(&mut self, new_rows: Vec<Row>)
pub fn append_rows(&mut self, new_rows: Vec<Row>)
pub fn rows(&self) -> &VecDeque<Row> ⓘ
pub fn get_cached_height(&self) -> Option<Dimension>
pub fn get_cached_depth(&self) -> Option<Dimension>
pub fn get_row_heights(&self) -> &[Dimension]
pub fn get_column_widths(&self) -> &[Dimension]
Sourcepub fn normalize(&mut self) -> Result<()>
pub fn normalize(&mut self) -> Result<()>
Run normalization (cell sizes, spans, pruning, positioning). Perl: $alignment->normalizeAlignment
pub fn add_line(&mut self, border: &str, cols: Vec<usize>)
pub fn next_column(&mut self) -> Result<Option<&mut Cell>>
pub fn last_column(&mut self) -> Option<&mut Cell>
pub fn current_column_number(&self) -> usize
Sourcepub fn set_row_property(&mut self, key: &str, value: String)
pub fn set_row_property(&mut self, key: &str, value: String)
Set a property on the current row (for attributes like backgroundcolor from \rowcolor)
pub fn current_row_number(&self) -> usize
Sourcepub fn get_name(&self) -> Option<&str>
pub fn get_name(&self) -> Option<&str>
The alignment’s name XML attribute (e.g. multline, gathered), set
via the container bindings. Perl reads $$alignment{properties}{attributes} {name}; here it lives in xml_attributes. Used by amsmath’s \shove*.
pub fn current_column(&mut self) -> Option<&mut Cell>
pub fn get_column(&mut self, n: usize) -> Option<&mut Cell>
pub fn get_column_mut(&mut self, n: usize) -> Option<&mut Cell>
pub fn add_before_row(&mut self, boxes: Vec<Digested>)
pub fn add_after_row(&mut self, boxes: Vec<Digested>)
pub fn omit_column(&mut self)
pub fn omit_next_column(&mut self)
pub fn get_column_before(&mut self) -> Tokens
pub fn get_column_after(&mut self) -> Tokens
pub fn revert(&self) -> Result<Tokens>
pub fn set_reversion(&mut self, rev: Tokens)
pub fn set_content_reversion(&mut self, rev: Tokens)
pub fn is_in_row(&self) -> bool
pub fn is_in_column(&self) -> bool
pub fn start_row(&mut self, pseudorow: bool) -> Result<()>
pub fn end_row(&mut self) -> Result<()>
pub fn start_column(&mut self, pseudorow: bool) -> Result<()>
pub fn end_column(&mut self) -> Result<()>
pub fn set_in_tabular_head(&mut self)
pub fn unset_in_tabular_head(&mut self)
pub fn is_in_tabular_head(&self) -> bool
pub fn get_properties_mut(&mut self) -> &mut SymHashMap<Stored>
pub fn get_xml_attributes_mut(&mut self) -> &mut HashMap<String, String>
Trait Implementations§
Source§impl BoxOps for Alignment
impl BoxOps for Alignment
Source§fn get_properties(&self) -> &SymHashMap<Stored>
fn get_properties(&self) -> &SymHashMap<Stored>
deprecated: get the map of named properties. This can not be usable as long as we have any
data behind a RefCell wrapper.
Use
with_properties instead.Source§fn with_properties<R, FnR>(&self, caller: FnR) -> R
fn with_properties<R, FnR>(&self, caller: FnR) -> R
execute a function using this object’s named properties
Source§fn get_property(&self, key: &str) -> Option<Cow<'_, Stored>>
fn get_property(&self, key: &str) -> Option<Cow<'_, Stored>>
get a single named property (with special “isSpace” check)
Source§fn get_properties_mut(&mut self) -> &mut SymHashMap<Stored>
fn get_properties_mut(&mut self) -> &mut SymHashMap<Stored>
get a mutable reference to the map of named properties
Source§fn compute_size(
&self,
_options: SymHashMap<Stored>,
) -> Result<(Dimension, Dimension, Dimension)>
fn compute_size( &self, _options: SymHashMap<Stored>, ) -> Result<(Dimension, Dimension, Dimension)>
computes and returns the size of a box-like object
Source§fn get_string(&self) -> Result<Cow<'_, str>>
fn get_string(&self) -> Result<Cow<'_, str>>
build a string representation of the underlying digested data
Source§fn compute_size_and_cache(
&mut self,
_options: SymHashMap<Stored>,
) -> Result<(Dimension, Dimension, Dimension)>
fn compute_size_and_cache( &mut self, _options: SymHashMap<Stored>, ) -> Result<(Dimension, Dimension, Dimension)>
computes and caches (via named properties) the size of a box-like object.
Perl #2798 (S5, padding slice): after computing the size, add any requested
pad{top,bottom,left,right} to the computed dimensions. This is the SAFE
part of computeSizeStore — additive and inert until the app layer sets a
pad* property (display math \abovedisplayskip/\belowdisplayskip,
\overline/\underline 2pt, items/equations). The riskier requested-vs-
computed merge + full-spec bypass + isEmpty are deliberately NOT included
here — a mechanical port of those regressed (Rust boxes don’t use
width/height/depth uniformly as “requested box size”); see SYNC_STATUS U2.Source§fn be_absorbed(&self, _document: &mut Document) -> Result<Vec<Node>>
fn be_absorbed(&self, _document: &mut Document) -> Result<Vec<Node>>
absorb the current object into the
Document XML - returning the corresponding nodesSource§fn be_absorbed_mut(&mut self, document: &mut Document) -> Result<Vec<Node>>
fn be_absorbed_mut(&mut self, document: &mut Document) -> Result<Vec<Node>>
be_absorbed but with allowed side-effects on the carrier (for
Alignment only)Source§fn unlist(&self) -> Vec<Digested>
fn unlist(&self) -> Vec<Digested>
If composite, unwrap into the contained digested objects (or return self)
fn unlist_ref(&self) -> Vec<Cow<'_, Digested>>
Source§fn get_tokens(&self) -> Option<&Tokens>
fn get_tokens(&self) -> Option<&Tokens>
get the underlying tokens (preceding digestion)
Source§fn set_property<T: Into<Stored>>(&mut self, key: &str, value: T)
fn set_property<T: Into<Stored>>(&mut self, key: &str, value: T)
set a named property (allows all
Stored types for values)fn get_property_string(&self, key: &str) -> String
Source§fn get_property_mut(&mut self, key: &str) -> Option<&mut Stored>
fn get_property_mut(&mut self, key: &str) -> Option<&mut Stored>
get a mutable reference to a single named property (does NOT have the “isSpace” check)
Source§fn has_property(&self, key: &str) -> bool
fn has_property(&self, key: &str) -> bool
checks if a property key has been set
Source§fn get_property_bool(&self, key: &str) -> bool
fn get_property_bool(&self, key: &str) -> bool
obtains a boolean property value (false unless
Stored::Bool)Source§fn get_body(&self) -> Result<Option<Digested>>
fn get_body(&self) -> Result<Option<Digested>>
obtains the “body” of a digested object which captured it
Source§fn get_width(
&self,
options: Option<HashMap<Stored>>,
) -> Result<Option<RegisterValue>>
fn get_width( &self, options: Option<HashMap<Stored>>, ) -> Result<Option<RegisterValue>>
gets the “width” property value, if any
Source§fn set_height<T: Into<Stored>>(&mut self, width: T)
fn set_height<T: Into<Stored>>(&mut self, width: T)
sets a “height” property value, for sizing
Source§fn get_height(&self) -> Option<RegisterValue>
fn get_height(&self) -> Option<RegisterValue>
gets the “height” property value, if any.
Checks “height”, then “cached_height”, then computes from font if needed.
Source§fn get_depth(&self) -> Option<RegisterValue>
fn get_depth(&self) -> Option<RegisterValue>
gets the “depth” property value, if any.
Checks “depth”, then “cached_depth”, then computes from font if needed.
Source§fn get_size(
&mut self,
options: Option<HashMap<Stored>>,
) -> Result<(Dimension, Dimension, Dimension, Dimension, Dimension, Dimension)>
fn get_size( &mut self, options: Option<HashMap<Stored>>, ) -> Result<(Dimension, Dimension, Dimension, Dimension, Dimension, Dimension)>
gets the box size as a triple of (width, height, depth)
the generic implementation is immutable and will recompute the size on each call
see
Digested::get_size for a variant with interior mutability which caches the box sizeSource§impl Object for Alignment
impl Object for Alignment
fn stringify(&self) -> String
fn isa_box(&self) -> bool
fn is_expandable(&self) -> bool
fn is_definition(&self) -> bool
fn is_comment(&self) -> bool
fn be_digested(self) -> Result<Digested>
Source§fn get_locator(&self) -> Option<Locator>
fn get_locator(&self) -> Option<Locator>
The object’s stored source locator, if it has one.
None is the honest
“no recorded source position” (replacing the old Locator::default()
file!()/line!() sentinel). For “where the parser is now” (error
reporting, box creation), use the free fn gullet::get_locator().Auto Trait Implementations§
impl !RefUnwindSafe for Alignment
impl !Send for Alignment
impl !Sync for Alignment
impl !UnwindSafe for Alignment
impl Freeze for Alignment
impl Unpin for Alignment
impl UnsafeUnpin for Alignment
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