pub struct NoteId(/* private fields */);Expand description
Bear note identifier (UUID-based).
This wraps Bear’s UUID identifier for notes. This is the identifier that Bear uses in its UI, x-callback-url API, and for syncing notes across devices.
§Creating IDs
You can create a NoteId from a UUID string:
use bear_query::NoteId;
let note_id = NoteId::new("ABC123-DEF456-...".to_string());§Usage
Use this ID for:
- Opening notes in Bear via x-callback-url:
bear://x-callback-url/open-note?id={uuid} - Storing stable references to notes that work across devices
- Matching notes in sync operations
This is Bear’s primary identifier for notes.
Implementations§
Source§impl NoteId
impl NoteId
Sourcepub fn new(uuid: String) -> Self
pub fn new(uuid: String) -> Self
Creates a new NoteId from a UUID string.
§Example
use bear_query::NoteId;
let note_id = NoteId::new("ABC123-DEF456-...".to_string());Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the UUID as a string slice.
§Example
use bear_query::NoteId;
let note_id = NoteId::new("ABC123-DEF456-...".to_string());
assert_eq!(note_id.as_str(), "ABC123-DEF456-...");Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the NoteId and returns the inner UUID string.
Trait Implementations§
Source§impl Ord for NoteId
impl Ord for NoteId
Source§impl PartialOrd for NoteId
impl PartialOrd for NoteId
impl Eq for NoteId
impl StructuralPartialEq for NoteId
Auto Trait Implementations§
impl Freeze for NoteId
impl RefUnwindSafe for NoteId
impl Send for NoteId
impl Sync for NoteId
impl Unpin for NoteId
impl UnwindSafe for NoteId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more