Struct CellContent

Source
pub struct CellContent {
    pub value: Value,
    pub style: Option<CellStyleRef>,
    pub formula: Option<String>,
    pub repeat: u32,
    pub validation_name: Option<ValidationRef>,
    pub span: CellSpan,
    pub matrix_span: CellSpan,
    pub annotation: Option<Box<Annotation>>,
    pub draw_frames: Vec<DrawFrame>,
}
Expand description

A copy of the relevant data for a spreadsheet cell.

Fields§

§value: Value

Cell value.

§style: Option<CellStyleRef>

Cell stylename.

§formula: Option<String>

Cell formula.

§repeat: u32

Cell repeat count.

§validation_name: Option<ValidationRef>

Reference to a validation rule.

§span: CellSpan

Cellspan.

§matrix_span: CellSpan

Matrix span.

§annotation: Option<Box<Annotation>>

Annotation

§draw_frames: Vec<DrawFrame>

DrawFrames

Implementations§

Source§

impl CellContent

Source

pub fn new() -> Self

Empty.

Source

pub fn value(&self) -> &Value

Returns the value.

Source

pub fn set_value<V: Into<Value>>(&mut self, value: V)

Sets the value.

Source

pub fn formula(&self) -> Option<&String>

Returns the formula.

Source

pub fn set_formula<V: Into<String>>(&mut self, formula: V)

Sets the formula.

Source

pub fn clear_formula(&mut self)

Resets the formula.

Source

pub fn style(&self) -> Option<&CellStyleRef>

Returns the cell style.

Source

pub fn set_style(&mut self, style: &CellStyleRef)

Sets the cell style.

Source

pub fn clear_style(&mut self)

Removes the style.

Source

pub fn set_repeat(&mut self, repeat: u32)

Sets the repeat count for the cell. Value must be > 0.

Source

pub fn get_repeat(&mut self) -> u32

Returns the repeat count for the cell.

Source

pub fn validation(&self) -> Option<&ValidationRef>

Returns the validation name.

Source

pub fn set_validation(&mut self, validation: &ValidationRef)

Sets the validation name.

Source

pub fn clear_validation(&mut self)

No validation.

Source

pub fn set_row_span(&mut self, rows: u32)

Sets the row span of this cell. Cells below with values will be lost when writing.

Source

pub fn row_span(&self) -> u32

Returns the row span.

Source

pub fn set_col_span(&mut self, cols: u32)

Sets the column span of this cell. Cells to the right with values will be lost when writing.

Source

pub fn col_span(&self) -> u32

Returns the col span.

Source

pub fn set_matrix_row_span(&mut self, rows: u32)

Sets the row span of this cell. Cells below with values will be lost when writing.

Source

pub fn matrix_row_span(&self) -> u32

Returns the row span.

Source

pub fn set_matrix_col_span(&mut self, cols: u32)

Sets the column span of this cell. Cells to the right with values will be lost when writing.

Source

pub fn matrix_col_span(&self) -> u32

Returns the col span.

Source

pub fn set_annotation(&mut self, annotation: Annotation)

Annotation

Source

pub fn clear_annotation(&mut self)

Annotation

Source

pub fn annotation(&self) -> Option<&Annotation>

Returns the Annotation

Source

pub fn set_draw_frames(&mut self, draw_frames: Vec<DrawFrame>)

Draw Frames

Source

pub fn draw_frames(&self) -> &Vec<DrawFrame>

Draw Frames

Trait Implementations§

Source§

impl Clone for CellContent

Source§

fn clone(&self) -> CellContent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CellContent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CellContent

Source§

fn default() -> CellContent

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.