Made Url serde-compatible
This commit is contained in:
parent
5e6eb6863c
commit
61784a9c55
2 changed files with 29 additions and 1 deletions
|
@ -2,6 +2,7 @@ use std::convert::TryFrom;
|
|||
use std::error::Error;
|
||||
|
||||
use url::Url;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::task::Task;
|
||||
use crate::task::TaskId;
|
||||
|
@ -9,6 +10,7 @@ use crate::task::TaskId;
|
|||
use bitflags::bitflags;
|
||||
|
||||
bitflags! {
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct SupportedComponents: u8 {
|
||||
/// An event, such as a calendar meeting
|
||||
const EVENT = 1;
|
||||
|
@ -45,9 +47,10 @@ impl TryFrom<minidom::Element> for SupportedComponents {
|
|||
|
||||
|
||||
/// A Caldav Calendar
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Calendar {
|
||||
name: String,
|
||||
#[serde(with="crate::utils::url_serde")]
|
||||
url: Url,
|
||||
supported_components: SupportedComponents,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue