Struct cloud_filter::root::SyncRootId
source · 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 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 moreAuto Trait Implementations§
impl Freeze for SyncRootId
impl RefUnwindSafe for SyncRootId
impl Send for SyncRootId
impl Sync for SyncRootId
impl Unpin for SyncRootId
impl UnwindSafe for SyncRootId
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)