[−][src]Struct trello::Card
Fields
id: String
name: String
desc: String
closed: bool
labels: Option<Vec<Label>>
Methods
impl Card
[src]
pub fn new(id: &str, name: &str, desc: &str) -> Card
[src]
pub fn parse(buffer: &str) -> Result<Card, SimpleError>
[src]
Takes a buffer of contents that represent a Card render and parses it into a Card structure. This is similar to a deserialization process except this is quite unstructured and is not very strict in order to allow the user to more easily edit card contents.
Card id is left empty as there is no way to derive that from the contents. The resultant card is also assumed to be open.
let buffer = "Hello World\n---\nThis is my card"; let card = trello::Card::parse(buffer)?; assert_eq!( card, trello::Card { id: String::new(), name: String::from("Hello World"), desc: String::from("This is my card"), labels: None, closed: false, }, );
Invalid data will result in an appropriate error being returned.
use simple_error::SimpleError; let buffer = ""; let result = trello::Card::parse(buffer); assert_eq!( result, Err(SimpleError::new("Unable to parse - Unable to find name delimiter '----'")) );
pub fn create(
client: &Client,
list_id: &str,
card: &Card
) -> Result<Card, Box<dyn Error>>
[src]
client: &Client,
list_id: &str,
card: &Card
) -> Result<Card, Box<dyn Error>>
pub fn update(client: &Client, card: &Card) -> Result<Card, Box<dyn Error>>
[src]
Trait Implementations
impl Debug for Card
[src]
impl<'de> Deserialize<'de> for Card
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Card
[src]
impl PartialEq<Card> for Card
[src]
impl StructuralEq for Card
[src]
impl StructuralPartialEq for Card
[src]
impl TrelloObject for Card
[src]
Auto Trait Implementations
impl RefUnwindSafe for Card
impl Send for Card
impl Sync for Card
impl Unpin for Card
impl UnwindSafe for Card
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,