[][src]Struct vimwiki_server::components::EnhancedListItem

pub struct EnhancedListItem {
    pub item: ListItem,
    pub attributes: HashSet<EnhancedListItemAttribute, RandomState>,
}

Represents a wrapper around a basic list item to provide extra information and functionality without needing to implement it for ordered/unordered list item instances directly

Fields

item: ListItemattributes: HashSet<EnhancedListItemAttribute, RandomState>

Implementations

impl EnhancedListItem[src]

pub fn new_with_attr(
    item: ListItem,
    attr: EnhancedListItemAttribute
) -> EnhancedListItem
[src]

Constructs an enhanced list item with a single attribute

pub fn item(&self) -> &ListItem[src]

Returns the underlying list item

pub fn is_todo(&self) -> bool[src]

Indicates if this component has todo information

pub fn compute_todo_progress(&self) -> Option<f32>[src]

Returns percent complete in form of 0.0 == 0% and 1.0 == 100%. This is a calculated percentage based on the sublist items (if there are any) or the item itself.

This will search through all sub list items, check if they have todo properties, and calculate a sum. If none of the sublists or any series of nested sublists contains todo items that are NOT rejected and this item does also not have todo progress, None will be returned.

pub fn is_todo_incomplete(&self) -> bool[src]

Indicates whether or not this component is incomplete, meaning no progress

pub fn is_todo_partially_complete(&self) -> bool[src]

Indicates whether or not this component is partially complete (any range)

pub fn is_todo_partially_complete_1(&self) -> bool[src]

Indicates whether or not this component is partially complete (1-33%)

pub fn is_todo_partially_complete_2(&self) -> bool[src]

Indicates whether or not this component is partially complete (34-66%)

pub fn is_todo_partially_complete_3(&self) -> bool[src]

Indicates whether or not this component is partially complete (67-99%)

pub fn is_todo_complete(&self) -> bool[src]

Indicates whether or not this component is complete

pub fn is_todo_rejected(&self) -> bool[src]

Indicates whether or not this component is rejected

impl EnhancedListItem[src]

pub fn new(
    item: ListItem,
    attributes: HashSet<EnhancedListItemAttribute, RandomState>
) -> EnhancedListItem
[src]

Methods from Deref<Target = ListItem>

pub fn is_unordered(&self) -> bool[src]

Indicates whether or not this list item represents an unordered item

pub fn is_ordered(&self) -> bool[src]

Indicates whether or not this list item represents an ordered item

pub fn to_prefix(&self) -> String[src]

Allocates a new string to represent the prefix of this list item

Trait Implementations

impl AsMut<ListItem> for EnhancedListItem[src]

impl AsRef<ListItem> for EnhancedListItem[src]

impl Clone for EnhancedListItem[src]

impl Debug for EnhancedListItem[src]

impl Default for EnhancedListItem[src]

impl Deref for EnhancedListItem[src]

type Target = ListItem

The resulting type after dereferencing.

impl DerefMut for EnhancedListItem[src]

impl<'de> Deserialize<'de> for EnhancedListItem[src]

impl Eq for EnhancedListItem[src]

impl From<EnhancedListItem> for ListItem[src]

impl From<ListItem> for EnhancedListItem[src]

impl PartialEq<EnhancedListItem> for EnhancedListItem[src]

impl Serialize for EnhancedListItem[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> Any for T where
    T: Any

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

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

impl<T> CloneAny for T where
    T: Clone + Any

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

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

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

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,