Skip to main content

List

Struct List 

Source
pub struct List { /* private fields */ }

Implementations§

Source§

impl List

Source

pub fn new() -> List

Source

pub fn from_string(serialized_string: String) -> List

Source

pub fn add_list_item(&mut self, item: ListItem, index: Option<usize>)

Source

pub fn add_existing_child_list_item( &mut self, item_id: &String, parent_id: &String, index: Option<usize>, ) -> Result<(), ListItemTaskError>

Source

pub fn add_child_list_item( &mut self, item: ListItem, parent_id: &String, index: Option<usize>, ) -> Result<(), ListItemTaskError>

Source

pub fn get_top_level_list_items(&self) -> Vec<&ListItem>

Source

pub fn get_children(&self, item: &ListItem) -> Vec<&ListItem>

Source

pub fn get_list_item(&self, id: &str) -> Option<&ListItem>

Source

pub fn get_mut_list_item(&mut self, id: &str) -> Option<&mut ListItem>

Source

pub fn remove_list_item( &mut self, id: &str, ) -> Result<(), ListItemDeletionError>

Source

pub fn remove_child_list_item( &mut self, child_id: &String, parent_id: Option<&String>, ) -> Result<(), ListItemDeletionError>

Source

pub fn into_string(&self) -> String

Source

pub fn get_index_of_child( &self, child_id: &String, parent_id: &String, ) -> Result<usize, ListItemTaskError>

Source

pub fn get_index_of_top_level_item( &self, child_id: &String, ) -> Result<usize, ListItemTaskError>

Trait Implementations§

Source§

impl Debug for List

Source§

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

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

impl<'de> Deserialize<'de> for List

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 Serialize for List

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

Auto Trait Implementations§

§

impl Freeze for List

§

impl RefUnwindSafe for List

§

impl Send for List

§

impl Sync for List

§

impl Unpin for List

§

impl UnsafeUnpin for List

§

impl UnwindSafe for List

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V