Struct Cell

Source
pub struct Cell {
    pub column_id: u64,
    pub column_type: Option<String>,
    pub conditional_format: Option<String>,
    pub hyperlink: Option<Hyperlink>,
    pub value: Option<CellValue>,
    pub display_value: Option<String>,
    pub object_value: Option<Value>,
    pub format: Option<String>,
    pub formula: Option<String>,
    pub image: Option<Image>,
    pub override_validation: Option<bool>,
    pub strict: Option<bool>,
}

Fields§

§column_id: u64

The Id of the column that the cell is located in.

§column_type: Option<String>

Only returned if the include query string parameter contains columnType.

§conditional_format: Option<String>

The format descriptor describing this cell’s conditional format. Only returned if the include query string parameter contains format and this cell has a conditional format applied.

§hyperlink: Option<Hyperlink>

Represents a hyperlink to a dashboard, report, sheet, or URL.

In the most common scenario, the hyperlink is a URL link, and the url property contains the URL value. This can more easily be retrieved via the Cell.link_url method.

§More info

  • https://smartsheet-platform.github.io/api-docs/#hyperlinks
  • https://smartsheet-platform.github.io/api-docs/#hyperlink-object
§value: Option<CellValue>

Cell.value represents a cell’s raw value and can be one of the following primitive JSON types: string, number, or Boolean, depending on the column type. An empty cell returns no value.

§More info

  • https://smartsheet-platform.github.io/api-docs/#cell-reference
§display_value: Option<String>

Cell.displayValue is always a string and is only returned for certain column types. It represents the formatted value as it should be displayed to an end-user.

§Examples

If a TEXT_NUMBER column is formatted as a US Dollar currency, its value may be a number like 1234.5678, but its displayValue is “$1,234.57”.

§More info

  • https://smartsheet-platform.github.io/api-docs/#cell-reference
§object_value: Option<Value>

Cell.objectValue is an object representation of a cell’s value and is currently used for adding or updating predecessor cell values, or for multi-contact details, such as email addresses.

§More info

  • https://smartsheet-platform.github.io/api-docs/#cell-reference
§format: Option<String>

The format descriptor. Only returned if the include query string parameter contains format and this cell has a non-default format applied.

§formula: Option<String>

The formula for a cell, if set, for instance =COUNTM([Assigned To]3).

Note that calculation errors or problems with a formula do not cause the API call to return an error code. Instead, the response contains the same value as in the UI, such as cell.value = "#CIRCULAR REFERENCE".

§image: Option<Image>

Cell Image object

§override_validation: Option<bool>

(Admin only) Indicates whether the cell value can contain a value outside of the validation limits (value = true). When using this parameter, you must also set strict to false to bypass value type checking. This property is honored for POST or PUT actions that update rows.

§strict: Option<bool>

Set to false to enable lenient parsing. Defaults to true. You can specify this attribute in a request, but it is never present in a response.

Implementations§

Source§

impl Cell

Source

pub fn new(column_id: u64) -> Self

Create a new Cell with a Column Id

Source

pub fn with_strict(self, strict: bool) -> Cell

Source

pub fn value_as_str(&self) -> Result<&str, Box<dyn Error + Send + Sync>>

Retrieve the Cell value as a string

Source

pub fn value_as_str_safe(&self) -> Option<&str>

Retrieve the Cell value as a string, but prefer to use an Option implementation instead, which can be unwrapped.

Source

pub fn value_as_number(&self) -> Result<&Number, Box<dyn Error + Send + Sync>>

Retrieve the Cell value as a Number

Source

pub fn value_as_bool(&self) -> Result<bool, Box<dyn Error + Send + Sync>>

Retrieve the Cell value as a boolean

Source

pub fn value_as_u64(&self) -> Result<u64, Box<dyn Error + Send + Sync>>

Retrieve the Cell value as an unsigned integer

Source

pub fn value_as_f64(&self) -> Result<f64, Box<dyn Error + Send + Sync>>

Retrieve the Cell value as a float

Source

pub fn display_value_as_str(&self) -> Result<&str, Box<dyn Error + Send + Sync>>

Retrieve the Cell display_value as a string

Source

pub fn display_value_as_str_safe(&self) -> Option<&str>

Retrieve the Cell display_value as a string, but prefer to use an Option implementation instead, which can be unwrapped.

Retrieve the Cell hyperlink URL as a string

Retrieve the Cell hyperlink URL as a string, but prefer to use an Option implementation instead, which can be unwrapped.

Source

pub fn values(&self) -> Result<&Vec<Value>, Box<dyn Error + Send + Sync>>

Get the underlying list of values of the object_value. This assumes that the objectType is either MULTI_PICKLIST or MULTI_CONTACT.

For more info, refer to the ObjectValue object.

Source

pub fn contacts( &self, ) -> Result<Vec<ContactOwned>, Box<dyn Error + Send + Sync>>

Retrieve info on a cell for a MULTI_CONTACT column. This returns a list containing a ContactOwned object for each contact in the cell.

You can then get additional info from the returned result, such as via the addrs_str() method for instance.

Check out the cell_multi_contact example for intended usage with this method.

Trait Implementations§

Source§

impl Clone for Cell

Source§

fn clone(&self) -> Cell

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

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Cell

Source§

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

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

impl Default for Cell

Source§

fn default() -> Cell

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

impl<'de> Deserialize<'de> for Cell

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Cell

Source§

fn eq(&self, other: &Cell) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Cell

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Cell

Auto Trait Implementations§

§

impl Freeze for Cell

§

impl RefUnwindSafe for Cell

§

impl Send for Cell

§

impl Sync for Cell

§

impl Unpin for Cell

§

impl UnwindSafe for Cell

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,