Struct FolderApi

Source
pub struct FolderApi<'a> { /* private fields */ }
Expand description

Actions on the FolderApi API

Implementations§

Source§

impl<'a> FolderApi<'a>

Source

pub async fn list(&self, details: Option<Details>) -> Result<Vec<Folder>, Error>

The list action lists all folders of the user except those in trash and the hidden ones.

Notes

  • The list will not include trashed folders
  • The list will not include hidden folders
  • The list will not include suspended folders where a parent folder is in the trash
Source

pub async fn get( &self, details: Option<Details>, id: Uuid, ) -> Result<Folder, Error>

The show action lists the properties of a single folder.

Notes

  • This is the only action that can access hidden folders
Source

pub async fn find( &self, criteria: FolderSearch, details: Option<Details>, ) -> Result<Vec<Folder>, Error>

The find action can be used to find all folders matching the given search criteria

Notes

  • The property trashed will be set to false if not present
  • The property parent is only supported in 2019.5.0 and later
  • The list will not include hidden folders
  • The list will not include suspended folders where a parent folder is in the trash
Source

pub async fn create( &self, value: CreateFolder, ) -> Result<FolderIdentifier, Error>

The create action creates a new folder with the given attributes.

Notes

  • If the uuid of the parent folder is invalid or does not exist, the base folder uuid will be used instead
  • If the folder is not hidden and should be created in a hidden folder, it will be created in the base folder instead
  • If the edited argument is “0”, missing or in the future, the current time will be used
Source

pub async fn update( &self, folder: UpdateFolder, ) -> Result<FolderIdentifier, Error>

The update action creates a new revision of a folder with an updated set of attributes.

Notes

  • If the uuid of the parent folder is invalid or does not exist, the base folder uuid will be used instead
  • If the folder is not hidden and should be moved to a hidden parent folder, it will be moved to the base folder instead
  • If you hide a folder, all folders and passwords in it will be hidden as well
  • If you unhide a folder no change to the folders and passwords in it will be made and they will remain hidden
  • If the edited argument is “0” or missing, the timestamp from the last revision will be used
  • If the edited time is in the future, the current time will be used
Source

pub async fn delete( &self, id: Uuid, revision: Option<Uuid>, ) -> Result<TrashedIdentifier, Error>

The delete action moves a folder and its content to the trash or deletes it completely if it is already in the trash.

Notes

  • If a folder is moved to the trash, all passwords and folders in it will be suspended and hidden from list and find actions
  • If a folder is moved to the trash, the relations between tags and passwords in the folder will be hidden from the tag, but not the password
  • If a folder is deleted, all passwords and folders in it will be deleted as well
  • If the revision is set, the folder will only be deleted if that revision is the current revision. This way, a folder is not accidentally deleted instead of trashed if the client is out of sync.
Source

pub async fn restore( &self, id: Uuid, revision: Option<Uuid>, ) -> Result<FolderIdentifier, Error>

The restore action can restore an earlier state of a folder.

Notes

  • If no revision is given and the folder is in trash, it will be removed from trash
  • If no revision is given and the folder is not in trash, nothing is done
  • If a revision is given and the revision is marked as in trash, it will be removed from trash
  • This action will always create a new revision
  • The server side encryption type may change
  • If the parent folder does not exist anymore, it will be moved to the base folder
  • Deleted folders can not be restored

Auto Trait Implementations§

§

impl<'a> Freeze for FolderApi<'a>

§

impl<'a> !RefUnwindSafe for FolderApi<'a>

§

impl<'a> Send for FolderApi<'a>

§

impl<'a> Sync for FolderApi<'a>

§

impl<'a> Unpin for FolderApi<'a>

§

impl<'a> !UnwindSafe for FolderApi<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,