[][src]Struct trello::Card

pub struct Card {
    pub id: String,
    pub name: String,
    pub desc: String,
    pub closed: bool,
    pub labels: Option<Vec<Label>>,
}

Fields

id: Stringname: Stringdesc: Stringclosed: boollabels: 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]

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]

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]

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

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

impl<T> DeserializeOwned for T where
    T: 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, 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.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

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

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