[][src]Struct trello::Card

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

Fields

id: Stringname: Stringdesc: Stringclosed: boolurl: Stringlabels: Option<Vec<Label>>

Methods

impl Card[src]

pub fn new(
    id: &str,
    name: &str,
    desc: &str,
    labels: Option<Vec<Label>>,
    url: &str
) -> Card
[src]

pub fn parse(buffer: &str) -> Result<CardContents, SimpleError>[src]

Takes a buffer of contents that represent a Card render and parses it into a CardContents 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.

let buffer = "Hello World\n===\nThis is my card";
let card_contents = trello::Card::parse(buffer)?;

assert_eq!(
    card_contents,
    trello::CardContents {
        name: String::from("Hello World"),
        desc: String::from("This is my card"),
    },
);

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]

pub fn apply_attachment(
    client: &Client,
    card_id: &str,
    file: &str
) -> Result<Attachment, Box<dyn Error>>
[src]

pub fn remove_label(
    client: &Client,
    card_id: &str,
    label_id: &str
) -> Result<(), Box<dyn Error>>
[src]

pub fn apply_label(
    client: &Client,
    card_id: &str,
    label_id: &str
) -> Result<(), Box<dyn Error>>
[src]

Trait Implementations

impl Clone for Card[src]

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> 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<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>,