pub struct CardContents {
pub name: String,
pub desc: String,
}
Fields§
§name: String
§desc: String
Trait Implementations§
Source§impl Debug for CardContents
impl Debug for CardContents
Source§impl FromStr for CardContents
impl FromStr for CardContents
Source§fn from_str(value: &str) -> Result<CardContents, TrelloError>
fn from_str(value: &str) -> Result<CardContents, TrelloError>
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::CardContents = buffer.parse()?;
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.
Source§type Err = TrelloError
type Err = TrelloError
The associated error which can be returned from parsing.
Source§impl PartialEq for CardContents
impl PartialEq for CardContents
impl Eq for CardContents
impl StructuralPartialEq for CardContents
Auto Trait Implementations§
impl Freeze for CardContents
impl RefUnwindSafe for CardContents
impl Send for CardContents
impl Sync for CardContents
impl Unpin for CardContents
impl UnwindSafe for CardContents
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<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.