QBAttachable

Trait QBAttachable 

Source
pub trait QBAttachable {
    // Required methods
    fn can_upload(&self) -> Result<(), QBTypeError>;
    fn file_path(&self) -> Option<&Path>;
}
Expand description

Trait for all entities that can be attached as files/notes.

Preconditions for upload:

  • file_name or note must be present;
  • file_path must be present.
  • content_type must be present.
  • can_upload() returns an error if required fields are missing.

Required Methods§

Source

fn can_upload(&self) -> Result<(), QBTypeError>

Returns Ok(()) when the instance has the fields required for upload.

Source

fn file_path(&self) -> Option<&Path>

Implementors§