Struct mongo_file_center::FileCenter [−][src]
pub struct FileCenter { /* fields omitted */ }To store perennial files and temporary files in MongoDB.
Implementations
impl FileCenter[src]
impl FileCenter[src]pub fn new<U: AsRef<str>>(uri: U) -> Result<FileCenter, FileCenterError>[src]
Create a new FileCenter instance.
pub fn new_with_file_size_threshold<U: AsRef<str>>(
uri: U,
initial_file_size_threshold: i32
) -> Result<FileCenter, FileCenterError>[src]
uri: U,
initial_file_size_threshold: i32
) -> Result<FileCenter, FileCenterError>
Create a new FileCenter instance with a custom initial file size threshold.
impl FileCenter[src]
impl FileCenter[src]pub fn set_file_size_threshold(
&mut self,
file_size_threshold: i32
) -> Result<(), FileCenterError>[src]
&mut self,
file_size_threshold: i32
) -> Result<(), FileCenterError>
Change the file size threshold.
pub fn drop_database(self) -> Result<(), FileCenterError>[src]
Drop the database.
pub fn drop_file_center(self) -> Result<(), FileCenterError>[src]
Drop the file center.
impl FileCenter[src]
impl FileCenter[src]pub fn get_file_item_by_id(
&self,
id: &ObjectId
) -> Result<Option<FileItem>, FileCenterError>[src]
&self,
id: &ObjectId
) -> Result<Option<FileItem>, FileCenterError>
Get the file item via an Object ID.
pub fn delete_file_item_by_id(
&self,
id: &ObjectId
) -> Result<Option<u64>, FileCenterError>[src]
&self,
id: &ObjectId
) -> Result<Option<u64>, FileCenterError>
Remove a file item via an Object ID.
pub fn put_file_by_path<P: AsRef<Path>, S: Into<String>>(
&self,
file_path: P,
file_name: Option<S>,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>[src]
&self,
file_path: P,
file_name: Option<S>,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>
Input a file to the file center via a file path.
pub fn put_file_by_path_temporarily<P: AsRef<Path>, S: Into<String>>(
&self,
file_path: P,
file_name: Option<S>,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>[src]
&self,
file_path: P,
file_name: Option<S>,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>
Temporarily input a file to the file center via a file path.
impl FileCenter[src]
impl FileCenter[src]pub fn put_file_by_buffer<S: Into<String>>(
&self,
buffer: Vec<u8>,
file_name: S,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>[src]
&self,
buffer: Vec<u8>,
file_name: S,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>
Input a file to the file center via a buffer.
pub fn put_file_by_buffer_temporarily<S: Into<String>>(
&self,
buffer: Vec<u8>,
file_name: S,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>[src]
&self,
buffer: Vec<u8>,
file_name: S,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>
Temporarily input a file to the file center via a buffer.
impl FileCenter[src]
impl FileCenter[src]pub fn put_file_by_reader<R: Read, S: Into<String>>(
&self,
reader: R,
file_name: S,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>[src]
&self,
reader: R,
file_name: S,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>
Input a file to the file center via a reader.
pub fn put_file_by_reader_temporarily<R: Read, S: Into<String>>(
&self,
reader: R,
file_name: S,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>[src]
&self,
reader: R,
file_name: S,
mime_type: Option<Mime>
) -> Result<FileItem, FileCenterError>
Temporarily input a file to the file center via a reader.
impl FileCenter[src]
impl FileCenter[src]pub fn clear_garbage(&self) -> Result<(), FileCenterError>[src]
Remove all unused files in GridFS and in the COLLECTION_FILES_NAME collection.
impl FileCenter[src]
impl FileCenter[src]pub fn database(&self) -> Result<Database, FileCenterError>[src]
Create an instance of MongoDB Database.
pub fn database_r2d2(
&self
) -> Result<PooledConnection<MongoConnectionManager>, FileCenterError>[src]
&self
) -> Result<PooledConnection<MongoConnectionManager>, FileCenterError>
Get an instance of R2D2 MongoDB Database.
impl FileCenter[src]
impl FileCenter[src]pub fn decrypt_id_token<S: AsRef<str>>(
&self,
id_token: S
) -> Result<ObjectId, FileCenterError>[src]
&self,
id_token: S
) -> Result<ObjectId, FileCenterError>
Decrypt a ID token to an Object ID.
pub fn encrypt_id(&self, id: &ObjectId) -> IDToken[src]
Encrypt an Object ID to an ID token.
pub fn encrypt_id_to_buffer(&self, id: &ObjectId, buffer: String) -> String[src]
Encrypt an Object ID to an ID token.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for FileCenter
impl !RefUnwindSafe for FileCenterimpl Send for FileCenter
impl Send for FileCenterimpl Sync for FileCenter
impl Sync for FileCenterimpl Unpin for FileCenter
impl Unpin for FileCenterimpl !UnwindSafe for FileCenter
impl !UnwindSafe for FileCenter