[][src]Struct places::msg_types::BookmarkNode

pub struct BookmarkNode {
    pub node_type: Option<i32>,
    pub guid: Option<String>,
    pub date_added: Option<i64>,
    pub last_modified: Option<i64>,
    pub parent_guid: Option<String>,
    pub position: Option<u32>,
    pub title: Option<String>,
    pub url: Option<String>,
    pub child_guids: Vec<String>,
    pub child_nodes: Vec<BookmarkNode>,
    pub have_child_nodes: Option<bool>,
}

A bookmark node.

We use a single message type for bookmarks. It covers insertion, deletion, and update, and represents all three bookmark types.

This simplifies the FFI by reducing the number of types that must go across it, and retuces boilderplate, but removes some static-ish guarantees we might have otherwise.

Note that these docs comments are internal, and don't necessarily impact the actual API we expose to Kotlin/Swift (this is particularly true around reads).

Fields

node_type: Option<i32>

The type of this bookmark, a BookmarkType (from types.rs).

This impacts which fields may be present.

It's illegal to attempt to change this when updating a bookmark.

Note: this probably should be an enum, but prost seems to get upset about it so we're just using int32 for now.

Note: this is node_type and not type because type is reserved in Rust.

guid: Option<String>

The bookmarks guid.

date_added: Option<i64>

Creation time, in milliseconds since the unix epoch.

May not be a local timestamp, and may shift if new devices are able to provide an earlier (but still valid) timestamp.

last_modified: Option<i64>

Last modification time, in milliseconds since the unix epoch.

parent_guid: Option<String>

Guid of the parent record.

position: Option<u32>

Zero based index within the parent.

title: Option<String>

Bookmark title. Not present for type = BookmarkType::Separator.

url: Option<String>

Bookmark URL. Only allowed/present for type = BookmarkType::Bookmark.

child_guids: Vec<String>

IDs of folder children, in order. Only present for type = BookmarkType::Folder.

child_nodes: Vec<BookmarkNode>

Data about folder children, in order. Only present for type = BookmarkType::Folder.

For performance reasons, this only is provided if it's requested.

have_child_nodes: Option<bool>

Returned by reads, and used to distinguish between the cases of "empty child_nodes because the API doesn't return children" and "empty child_nodes because this folder has no children (but we'd populate them if it had them)".

Only required because you can't have optional repeated.

Leaving this out is equivalent to false.

Implementations

impl BookmarkNode[src]

pub(crate) fn get_node_type(&self) -> BookmarkType[src]

Get the BookmarkType, panicking if it's invalid (because it really never should be unless we have a bug somewhere).

pub fn into_insertable(self) -> Result<InsertableItem>[src]

Convert the protobuf bookmark into information for insertion.

impl BookmarkNode[src]

pub fn node_type(&self) -> i32[src]

Returns the value of node_type, or the default value if node_type is unset.

pub fn guid(&self) -> &str[src]

Returns the value of guid, or the default value if guid is unset.

pub fn date_added(&self) -> i64[src]

Returns the value of date_added, or the default value if date_added is unset.

pub fn last_modified(&self) -> i64[src]

Returns the value of last_modified, or the default value if last_modified is unset.

pub fn parent_guid(&self) -> &str[src]

Returns the value of parent_guid, or the default value if parent_guid is unset.

pub fn position(&self) -> u32[src]

Returns the value of position, or the default value if position is unset.

pub fn title(&self) -> &str[src]

Returns the value of title, or the default value if title is unset.

pub fn url(&self) -> &str[src]

Returns the value of url, or the default value if url is unset.

pub fn have_child_nodes(&self) -> bool[src]

Returns the value of have_child_nodes, or the default value if have_child_nodes is unset.

Trait Implementations

impl Clone for BookmarkNode[src]

impl Debug for BookmarkNode[src]

impl Default for BookmarkNode[src]

impl From<BookmarkNode> for BookmarkUpdateInfo[src]

impl From<PublicNode> for BookmarkNode[src]

impl IntoFfi for BookmarkNode where
    BookmarkNode: Message
[src]

type Value = ByteBuffer

This type must be: Read more

impl Message for BookmarkNode[src]

impl PartialEq<BookmarkNode> for BookmarkNode[src]

impl StructuralPartialEq for BookmarkNode[src]

Auto Trait Implementations

impl RefUnwindSafe for BookmarkNode

impl Send for BookmarkNode

impl Sync for BookmarkNode

impl Unpin for BookmarkNode

impl UnwindSafe for BookmarkNode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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