mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-12 10:03:51 +00:00
* craft-mime: strict base64, mailto links and code page labels from MailCraft What MailCraft's mime and charset crates still had that craft-mime did not: strict RFC 4648 base64 (crates/charset), mailto: links (RFC 6068, crates/mime) and the Windows code page to charset label table (crates/pst). With these, MailCraft's charset crate has nothing craft-mime lacks. * Add craft-vcard: vCard reader and writer from MailCraft MailCraft crates/vcard at a44a450: vCard 2.1, 3.0 and 4.0 read, 3.0 written, with its limits and tests. The model is the crate's own Contact (the vCard fields of MailCraft's); the birthday is a chrono::NaiveDate. Character sets and strict base64 come from craft-mime. --------- Co-authored-by: Martin Ball <98639962+benandez@users.noreply.github.com>
27 lines
880 B
Rust
27 lines
880 B
Rust
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
|
|
#![forbid(unsafe_code)]
|
|
|
|
//! vCard: contacts as vCard text (`.vcf` files, CardDAV address data).
|
|
//!
|
|
//! [`parse`] reads vCard 2.1, 3.0 and 4.0, one card or many in a text ([`parse_bytes`] in a file,
|
|
//! each value in its own `CHARSET`); [`write()`] writes vCard 3.0, the version every address book
|
|
//! reads. Both work on [`Contact`], this crate's own plain model of a card.
|
|
//!
|
|
//! Input is hostile. Nothing here panics on any text: line lengths and counts are capped, and what
|
|
//! makes no sense is skipped.
|
|
|
|
mod key;
|
|
#[cfg(test)]
|
|
mod key_tests;
|
|
mod lines;
|
|
mod model;
|
|
mod read;
|
|
#[cfg(test)]
|
|
mod tests;
|
|
mod text;
|
|
mod write;
|
|
|
|
pub use model::{Contact, ContactKey, KeyKind, Labeled, PostalAddress};
|
|
pub use read::{parse, parse_bytes};
|
|
pub use write::write;
|