UnsyncPost

Struct UnsyncPost 

Source
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: String

The original URL of this post (e.g., “https://example.com/blog/1”)

§title: String

The 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: PlatformId

Platform associated with the post

§tags: Vec<UnsyncTag>

Tags associated with the post

§authors: Vec<AuthorId>

The IDs of the author who created this post

§collections: Vec<UnsyncCollection>

The collections this post belongs to

Implementations§

Source§

impl<T> UnsyncPost<T>

Source

pub fn new( platform: PlatformId, source: String, title: String, content: Vec<UnsyncContent<T>>, ) -> Self

Source

pub fn source(self, source: String) -> Self

Source

pub fn title(self, title: String) -> Self

Source

pub fn content(self, content: Vec<UnsyncContent<T>>) -> Self

Source

pub fn thumb(self, thumb: Option<UnsyncFileMeta<T>>) -> Self

Source

pub fn comments(self, comments: Vec<Comment>) -> Self

Source

pub fn updated(self, updated: DateTime<Utc>) -> Self

Source

pub fn published(self, published: DateTime<Utc>) -> Self

Source

pub fn platform(self, platform: PlatformId) -> Self

Source

pub fn tags(self, tags: Vec<UnsyncTag>) -> Self

Source

pub fn authors(self, authors: Vec<AuthorId>) -> Self

Source

pub fn collections(self, collections: Vec<UnsyncCollection>) -> Self

Source

pub fn sync<U>( self, manager: &PostArchiverManager<U>, ) -> Result<(PostId, Vec<(PathBuf, T)>), Error>

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>

Source§

fn clone(&self) -> UnsyncPost<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for UnsyncPost<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.