pub struct VCard(pub Vec<Component>);Available on crate feature
read_write only.Expand description
A VCard represents an individual vcard within a vcard
file. For the most part this will represent Contact.
It implements display to allow you to convert it to a text form of VCard.
Tuple Fields§
§0: Vec<Component>Implementations§
Source§impl VCard
impl VCard
Sourcepub fn new(vec: Vec<Component>) -> Self
pub fn new(vec: Vec<Component>) -> Self
Creates a new VCard
The vec of components does not need to include a
BEGIN, END or VERSION.
Sourcepub fn from_str_to_vec(s: &str) -> Result<Vec<Self>, ComponentParseError>
pub fn from_str_to_vec(s: &str) -> Result<Vec<Self>, ComponentParseError>
Creates a vector of VCards from a string.
They are separated by END:VCARD\r\n.
§Errors
Fails for the same reason as during the FromStr
implementation.
Sourcepub fn from_slice_to_string(v: &[Self]) -> String
pub fn from_slice_to_string(v: &[Self]) -> String
Converts a slice to a String.
This creates many VCards separated by END:VCARD
Trait Implementations§
impl Eq for VCard
impl StructuralPartialEq for VCard
Auto Trait Implementations§
impl Freeze for VCard
impl RefUnwindSafe for VCard
impl Send for VCard
impl Sync for VCard
impl Unpin for VCard
impl UnwindSafe for VCard
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<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 moreSource§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: Sized + AsExpression<T>,
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self to an expression for Diesel’s query builder. Read more