Entry

Struct Entry 

Source
pub struct Entry {
Show 26 fields pub annotations: Option<Annotations>, pub content: Option<String>, pub created_at: DateTime<Utc>, pub domain_name: Option<String>, pub headers: Option<HashMap<String, String>>, pub http_status: Option<String>, pub id: ID, pub is_archived: bool, pub is_public: bool, pub is_starred: bool, pub language: Option<String>, pub mimetype: Option<String>, pub origin_url: Option<String>, pub preview_picture: Option<String>, pub published_at: Option<DateTime<Utc>>, pub published_by: Option<Vec<Option<String>>>, pub reading_time: u32, pub starred_at: Option<DateTime<Utc>>, pub tags: Tags, pub title: Option<String>, pub uid: Option<String>, pub updated_at: DateTime<Utc>, pub url: Option<String>, pub user_email: String, pub user_id: ID, pub user_name: String,
}
Expand description

A struct representing an entry from wallabag (a full saved article including all annotations and tags; annotations and tags do not need to be requested separately).

Most fields are controlled by the server. When creating an entry, the server will send a request to the given url and use the response to populate many of the fields. This response is what headers, http_status, mimetype, etc. are referring to.

Fields§

§annotations: Option<Annotations>

Annotation objects for this entry.

§content: Option<String>

Content. Should be HTML if present.

§created_at: DateTime<Utc>

The timestamp of when the entry was created on the server.

§domain_name: Option<String>

The resolved domain name of the url. Could be None if the server couldn’t resolve the url.

§headers: Option<HashMap<String, String>>

A map of header name -> header value. These appear to be headers from the original source url.

§http_status: Option<String>

I’m guessing this is the status the server got when retrieving the content from the url.

§id: ID

ID of the entry. Should be an integer. Should also be unique, so can use this directly as the local id if storing the entry in a DB.

§is_archived: bool

The archived (or read) status of the entry. These boolean options are sometimes represented as 0 or 1 from the API, which makes parsing in a strongly typed language annoying.

§is_public: bool

The public shared status of the entry. If this is true, then there should be a public link to this exact entry on the server. The link will be based around the value of the uid field and (TODO: confirm if this can be relied on) formatted as BASE_URL/share/UID.

§is_starred: bool

The starred status of the entry.

§language: Option<String>

The language of the entry - probably generated by the server from inspecting the response.

§mimetype: Option<String>

The mimetype of the entry - probably generated by the server from inspecting the response. Not sure about the support status for other mimetypes. Observed behaviour suggests that the server converts everything to HTML - eg. a text/plain mimetype content will be plain text surrounded by <pre> tags.

§origin_url: Option<String>

Supposedly the original url given will be stored here. If a shortened link is submitted to the server, the short link will be here, but the resolved link will be in URL. Observed behaviour is that this field is never set.

§preview_picture: Option<String>

Optional url for an image related to the entry. Eg. for displaying as a background image to the entry tile.

§published_at: Option<DateTime<Utc>>

Data about when the entry was published (scraped from the original web page).

§published_by: Option<Vec<Option<String>>>

Data about who published the entry (scraped from the original web page).

§reading_time: u32

Estimated reading time in minutes. Generated by the server, probably based off your set reading speed or a default.

§starred_at: Option<DateTime<Utc>>

Timestamp of when the entry was starred, if it is starred. Unstarring an entry sets this to None.

§tags: Tags

A list of tag objects associated with this entry.

§title: Option<String>

An optional title for the entry.

§uid: Option<String>

This will be only set by the server as a unique id to identify the entry if it has been shared. For example if you share via public link on framabag and the uid is FOO, then the public url will be framabag.org/share/FOO

§updated_at: DateTime<Utc>

Timestamp when the entry was last updated. This is bumped for any change to any field attached to the entry except for annotations.

TODO: check if entry updates if a tag is globally edited (eg. renamed)

§url: Option<String>

Resolved url of the entry. If the origin_url redirected to a different url (eg. via a shortened link), the final url will be stored here.

§user_email: String

Email of the user who owns this entry. Currently user_* fields are redundant since you can only access entries that belong to you. Entry sharing between users is planned for the future so this may become relevant soon.

§user_id: ID

ID of the user who owns this entry.

§user_name: String

username of the user who owns this entry.

Trait Implementations§

Source§

impl Debug for Entry

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Entry

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&Entry> for ID

This is implemented so that an &Entry can be used interchangeably with an ID for some client methods. For convenience.

Source§

fn from(entry: &Entry) -> Self

Converts to this type from the input type.
Source§

impl From<&Entry> for PatchEntry

Convert an Entry to a set of changes ready for sending to the api.

Source§

fn from(entry: &Entry) -> Self

Converts to this type from the input type.
Source§

impl From<Entry> for ID

This is implemented so that an Entry can be used interchangeably with an ID for some client methods. For convenience.

Source§

fn from(entry: Entry) -> Self

Converts to this type from the input type.
Source§

impl Serialize for Entry

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Entry

§

impl RefUnwindSafe for Entry

§

impl Send for Entry

§

impl Sync for Entry

§

impl Unpin for Entry

§

impl UnwindSafe for Entry

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,