[][src]Struct zenkit::Item

pub struct Item<'li> { /* fields omitted */ }

Item in a list

Implementations

impl<'li> Item<'li>[src]

pub fn as_entry(&self) -> &Entry[src]

returns reference to the inner entry

pub fn get_id(&self) -> ID[src]

return entry id

pub fn get_uuid(&self) -> &UUID[src]

Returns entry uuid

pub fn get_field(&self, field_id: &str) -> Result<&Field, Error>[src]

Returns field (definition) given its name, id, or uuid

pub fn get_text_value(&self, fname: &str) -> Result<Option<&str>, Error>[src]

Returns value of text field. or None if not defined fname parameter may be field name, id, or uuid

pub fn take_text_value(&mut self, fname: &str) -> Option<String>[src]

If text field is defined, returns owned string This can be useful to avoid memory allocation if the string field is expected to be large

pub fn get_int_value(&self, fname: &str) -> Result<Option<i64>, Error>[src]

Returns value of integer field as i64. or None if not defined fname parameter may be field name, id, or uuid

pub fn get_float_value(&self, fname: &str) -> Result<Option<f64>, Error>[src]

Returns value of float field. or None if not defined fname parameter may be field name, id, or uuid

pub fn get_date_value(&self, fname: &str) -> Result<Option<&str>, Error>[src]

Returns value of date field. or None if not defined fname parameter may be field name, id, or uuid

pub fn get_person_names(&self, fname: &str) -> Result<Vec<&str>, Error>[src]

Returns display names of persons in field value. fname parameter may be field name, id, or uuid

pub fn get_person_ids(&self, fname: &str) -> Result<Vec<ID>, Error>[src]

Returns IDs of persons in field value. fname parameter may be field name, id, or uuid

pub fn get_references(&self, fname: &str) -> Result<Vec<&str>, Error>[src]

Returns uuids of referred objects in field value. fname parameter may be field name, id, or uuid

pub fn get_choices(&self, fname: &str) -> Result<Vec<&str>, Error>[src]

Returns array of choice (aka label/category) values. Array could be empty if none are selected

pub fn get_choice(&self, fname: &str) -> Result<Option<&str>, Error>[src]

Returns single choice value, or None if unselected. This will return an error if multiple values are selected, which would mean that the programmer believed the field had multiple-choices disabled, and they were enabled in the UI.

Methods from Deref<Target = Entry>

pub fn get_text_value(&self, field_uuid: &str) -> Result<Option<&str>, Error>[src]

Returns value of text string or None if undefined

pub fn get_int_value(&self, field_uuid: &str) -> Result<Option<i64>, Error>[src]

Returns int value of numeric field

pub fn get_float_value(&self, field_uuid: &str) -> Result<Option<f64>, Error>[src]

Returns float value of numeric field

pub fn get_date_value(&self, field_uuid: &str) -> Result<Option<&str>, Error>[src]

Returns value of date string or None if undefined

pub fn get_category_names(&self, field_uuid: &str) -> Result<Vec<&str>, Error>[src]

Returns category value(s) (as strings)

pub fn get_category_ids(&self, field_uuid: &str) -> Result<Vec<ID>, Error>[src]

Returns category ids

pub fn get_person_names(&self, field_uuid: &str) -> Result<Vec<&str>, Error>[src]

Returns display names of people or empty array if no people (or invalid field)

pub fn get_person_ids(&self, field_uuid: &str) -> Result<Vec<ID>, Error>[src]

Returns IDs of people or empty array if no people (or invalid field)

pub fn get_references(&self, field_uuid: &str) -> Result<Vec<&str>, Error>[src]

Returns UUIDs of referent items, or empty array

Trait Implementations

impl<'li> Debug for Item<'li>[src]

impl<'li> Deref for Item<'li>[src]

type Target = Entry

The resulting type after dereferencing.

Auto Trait Implementations

impl<'li> RefUnwindSafe for Item<'li>

impl<'li> Send for Item<'li>

impl<'li> Sync for Item<'li>

impl<'li> Unpin for Item<'li>

impl<'li> UnwindSafe for Item<'li>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.