pub struct List {
pub id: String,
pub name: String,
pub closed: bool,
pub cards: Option<Vec<Card>>,
}
Fields§
§id: String
§name: String
§closed: bool
§cards: Option<Vec<Card>>
Implementations§
Source§impl List
impl List
pub fn new(id: &str, name: &str, cards: Option<Vec<Card>>) -> List
Sourcepub fn filter(&self, label_filter: &str) -> List
pub fn filter(&self, label_filter: &str) -> List
Filters cards that match the given label_filter (As a regular expression). Returns a copy of the original List, with the correct filtering applied.
use trello::{Card, Label, List};
let list = List::new(
"123",
"TODO",
Some(vec![
Card::new("1", "Orange", "", Some(vec![Label::new("", "fruit", "")]), ""),
Card::new("2", "Green", "", None, ""),
])
);
assert_eq!(
list.filter("idontexist"),
List::new(
"123",
"TODO",
Some(vec![]),
)
);
assert_eq!(
list.filter("fruit"),
List::new(
"123",
"TODO",
Some(vec![
Card::new("1", "Orange", "", Some(vec![Label::new("", "fruit", "")]), "")
])
)
);
pub fn create( client: &Client, board_id: &str, name: &str, ) -> Result<List, TrelloError>
pub fn open(client: &Client, list_id: &str) -> Result<List, TrelloError>
pub fn update(client: &Client, list: &List) -> Result<List, TrelloError>
pub fn get_all( client: &Client, board_id: &str, cards: bool, ) -> Result<Vec<List>, TrelloError>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for List
impl<'de> Deserialize<'de> for List
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 TrelloObject for List
impl TrelloObject for List
impl Eq for List
impl StructuralPartialEq for List
Auto Trait Implementations§
impl Freeze for List
impl RefUnwindSafe for List
impl Send for List
impl Sync for List
impl Unpin for List
impl UnwindSafe for List
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more