[−][src]Struct places::observation::VisitObservation
An "observation" based model for updating history. You create a VisitObservation, call functions on it which correspond with what you observed. The page will then be updated using this info.
It's implemented such that the making of an "observation" is itself
significant - it records what specific changes should be made to storage.
For example, instead of simple bools with defaults (where you can't
differentiate explicitly setting a value from the default value), we use
Option
It exposes a "builder api", but for convenience, that API allows Options too.
So, eg, .with_title(None)
or with_is_error(None)
is allowed but records
no observation.
Fields
url: String
Ideally, we'd use url::Url here with serde_url
, but we really would
like to expose these errors over the FFI as UrlParseErrors and not json
errors, and we also would like to do so without parsing strings.
title: Option<String>
visit_type: Option<VisitTransition>
is_error: Option<bool>
is_redirect_source: Option<bool>
is_permanent_redirect_source: Option<bool>
at: Option<Timestamp>
referrer: Option<String>
Semantically also a url::Url, See the comment about the url
property.
is_remote: Option<bool>
Implementations
impl VisitObservation
[src][−]
pub fn new(url: Url) -> Self
[src]
pub fn with_title(self, t: impl Into<Option<String>>) -> Self
[src]
pub fn with_visit_type(self, t: impl Into<Option<VisitTransition>>) -> Self
[src]
pub fn with_is_error(self, v: impl Into<Option<bool>>) -> Self
[src]
pub fn with_is_redirect_source(self, v: impl Into<Option<bool>>) -> Self
[src]
pub fn with_is_permanent_redirect_source(
self,
v: impl Into<Option<bool>>
) -> Self
[src]
self,
v: impl Into<Option<bool>>
) -> Self
pub fn with_at(self, v: impl Into<Option<Timestamp>>) -> Self
[src]
pub fn with_is_remote(self, v: impl Into<Option<bool>>) -> Self
[src]
pub fn with_referrer(self, v: impl Into<Option<Url>>) -> Self
[src]
pub fn get_redirect_frecency_boost(&self) -> bool
[src]
pub fn get_is_hidden(&self) -> bool
[src]
Trait Implementations
impl Debug for VisitObservation
[src][+]
impl<'de> Deserialize<'de> for VisitObservation
[src][+]
impl Serialize for VisitObservation
[src][+]
Auto Trait Implementations
impl RefUnwindSafe for VisitObservation
impl Send for VisitObservation
impl Sync for VisitObservation
impl Unpin for VisitObservation
impl UnwindSafe for VisitObservation
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[+]
V: MultiLane<T>,