mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 22:52:22 +00:00
Move ical-related stuff to rustical_ical crate
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
use super::ChangeOperation;
|
||||
use async_trait::async_trait;
|
||||
use derive_more::derive::Constructor;
|
||||
use rustical_ical::AddressObject;
|
||||
use rustical_store::{
|
||||
AddressObject, Addressbook, AddressbookStore, CollectionOperation, CollectionOperationDomain,
|
||||
Addressbook, AddressbookStore, CollectionOperation, CollectionOperationDomain,
|
||||
CollectionOperationType, Error, synctoken::format_synctoken,
|
||||
};
|
||||
use sqlx::{Acquire, Executor, Sqlite, SqlitePool, Transaction};
|
||||
|
||||
@@ -2,11 +2,10 @@ use super::ChangeOperation;
|
||||
use async_trait::async_trait;
|
||||
use chrono::TimeDelta;
|
||||
use derive_more::derive::Constructor;
|
||||
use rustical_ical::CalDateTime;
|
||||
use rustical_store::calendar::CalendarObjectType;
|
||||
use rustical_ical::{CalDateTime, CalendarObject, CalendarObjectType};
|
||||
use rustical_store::calendar_store::CalendarQuery;
|
||||
use rustical_store::synctoken::format_synctoken;
|
||||
use rustical_store::{Calendar, CalendarObject, CalendarStore, Error};
|
||||
use rustical_store::{Calendar, CalendarStore, Error};
|
||||
use rustical_store::{CollectionOperation, CollectionOperationType};
|
||||
use sqlx::types::chrono::NaiveDateTime;
|
||||
use sqlx::{Acquire, Executor, Sqlite, SqlitePool, Transaction};
|
||||
@@ -23,7 +22,7 @@ impl TryFrom<CalendarObjectRow> for CalendarObject {
|
||||
type Error = rustical_store::Error;
|
||||
|
||||
fn try_from(value: CalendarObjectRow) -> Result<Self, Self::Error> {
|
||||
CalendarObject::from_ics(value.id, value.ics)
|
||||
Ok(CalendarObject::from_ics(value.id, value.ics)?)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ pub enum Error {
|
||||
|
||||
#[error(transparent)]
|
||||
StoreError(rustical_store::Error),
|
||||
|
||||
#[error(transparent)]
|
||||
IcalError(#[from] rustical_ical::Error),
|
||||
}
|
||||
|
||||
impl From<sqlx::Error> for Error {
|
||||
@@ -27,6 +30,7 @@ impl From<Error> for rustical_store::Error {
|
||||
fn from(value: Error) -> Self {
|
||||
match value {
|
||||
Error::SqlxError(err) => Self::Other(err.into()),
|
||||
Error::IcalError(err) => Self::Other(err.into()),
|
||||
Error::StoreError(err) => err,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user