pub struct SyncRootId(/* private fields */);
Expand description
The identifier for a sync root.
The inner value comes in the form:
provider-id!security-id!account-name
as specified
here.
A SyncRootId stores an inner, reference counted HSTRING, making this struct cheap to clone.
Implementations§
Source§impl SyncRootId
impl SyncRootId
Sourcepub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Creates a SyncRootId from the sync root at the given path.
Sourcepub fn is_registered(&self) -> Result<bool>
pub fn is_registered(&self) -> Result<bool>
Whether or not the SyncRootId has already been registered.
Sourcepub fn info(&self) -> Result<SyncRootInfo>
pub fn info(&self) -> Result<SyncRootInfo>
Returns the sync root information for the SyncRootId.
Sourcepub fn register(&self, info: SyncRootInfo) -> Result<()>
pub fn register(&self, info: SyncRootInfo) -> Result<()>
Registers the sync root at the current SyncRootId.
SyncRootInfo::display_name, SyncRootInfo::icon, SyncRootInfo::version and SyncRootInfo::path are required and cannot be empty.
Sourcepub fn unregister(&self) -> Result<()>
pub fn unregister(&self) -> Result<()>
Unregisters the sync root at the current SyncRootId if it exists.
Sourcepub fn index(&self) -> Result<()>
pub fn index(&self) -> Result<()>
Indexes the sync root at the current SyncRootId.
Returns an error if the sync root does not exist or unable to index.
Sourcepub fn to_os_string(&self) -> OsString
pub fn to_os_string(&self) -> OsString
Encodes the SyncRootId to an OsString.
Sourcepub fn as_u16_str(&self) -> &U16Str
pub fn as_u16_str(&self) -> &U16Str
A reference to the SyncRootId as a 16 bit string.
Sourcepub fn as_hstring(&self) -> &HSTRING
pub fn as_hstring(&self) -> &HSTRING
A reference to the SyncRootId as an HSTRING (its inner value).
Sourcepub fn to_components(&self) -> (&U16Str, &U16Str, &U16Str)
pub fn to_components(&self) -> (&U16Str, &U16Str, &U16Str)
The three components of a SyncRootId as described by the specification.
The order goes as follows:
(provider-id, security-id, account-name)
§Panics
Panics if the sync root id does not have exactly three components.
Trait Implementations§
Source§impl Clone for SyncRootId
impl Clone for SyncRootId
Source§fn clone(&self) -> SyncRootId
fn clone(&self) -> SyncRootId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more