pub struct UnsyncPost<T> {
pub source: String,
pub title: String,
pub content: Vec<UnsyncContent<T>>,
pub thumb: Option<UnsyncFileMeta<T>>,
pub comments: Vec<Comment>,
pub updated: Option<DateTime<Utc>>,
pub published: Option<DateTime<Utc>>,
pub platform: PlatformId,
pub tags: Vec<UnsyncTag>,
pub authors: Vec<AuthorId>,
pub collections: Vec<UnsyncCollection>,
}Available on crate feature
importer only.Expand description
Represents a post that is not yet synchronized with the archive.
Fields§
§source: StringThe original URL of this post (e.g., “https://example.com/blog/1”)
title: StringThe title of the post
content: Vec<UnsyncContent<T>>The post’s content items (text and file references)
thumb: Option<UnsyncFileMeta<T>>Optional thumbnail image for the post
comments: Vec<Comment>Comments on the post
updated: Option<DateTime<Utc>>When the post was updated
published: Option<DateTime<Utc>>When the post was published
platform: PlatformIdPlatform associated with the post
Tags associated with the post
The IDs of the author who created this post
collections: Vec<UnsyncCollection>The collections this post belongs to
Implementations§
Source§impl<T> UnsyncPost<T>
impl<T> UnsyncPost<T>
pub fn new( platform: PlatformId, source: String, title: String, content: Vec<UnsyncContent<T>>, ) -> Self
pub fn source(self, source: String) -> Self
pub fn title(self, title: String) -> Self
pub fn content(self, content: Vec<UnsyncContent<T>>) -> Self
pub fn thumb(self, thumb: Option<UnsyncFileMeta<T>>) -> Self
pub fn comments(self, comments: Vec<Comment>) -> Self
pub fn updated(self, updated: DateTime<Utc>) -> Self
pub fn published(self, published: DateTime<Utc>) -> Self
pub fn platform(self, platform: PlatformId) -> Self
pub fn collections(self, collections: Vec<UnsyncCollection>) -> Self
Sourcepub fn sync<U>(
self,
manager: &PostArchiverManager<U>,
) -> Result<(PostId, Vec<(PathBuf, T)>), Error>where
U: PostArchiverConnection,
pub fn sync<U>(
self,
manager: &PostArchiverManager<U>,
) -> Result<(PostId, Vec<(PathBuf, T)>), Error>where
U: PostArchiverConnection,
import this post into the archive, synchronizing it with the database.
This is abbreviation for import_post
§Errors
Returns rusqlite::Error if there was an error accessing the database.
Trait Implementations§
Source§impl<T: Clone> Clone for UnsyncPost<T>
impl<T: Clone> Clone for UnsyncPost<T>
Source§fn clone(&self) -> UnsyncPost<T>
fn clone(&self) -> UnsyncPost<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for UnsyncPost<T>where
T: Freeze,
impl<T> RefUnwindSafe for UnsyncPost<T>where
T: RefUnwindSafe,
impl<T> Send for UnsyncPost<T>where
T: Send,
impl<T> Sync for UnsyncPost<T>where
T: Sync,
impl<T> Unpin for UnsyncPost<T>where
T: Unpin,
impl<T> UnwindSafe for UnsyncPost<T>where
T: UnwindSafe,
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