[−][src]Struct mongo_file_center::FileCenter
To store perennial files and temporary files in MongoDB.
Methods
impl FileCenter
[src]
pub fn new<U: AsRef<str>, D: AsRef<str>>(
uri: U,
database: D
) -> Result<FileCenter, FileCenterError>
[src]
uri: U,
database: D
) -> Result<FileCenter, FileCenterError>
Create a new FileCenter instance.
pub fn new_with_file_size_threshold<U: AsRef<str>, D: AsRef<str>>(
uri: U,
database: D,
initial_file_size_threshold: i32
) -> Result<FileCenter, FileCenterError>
[src]
uri: U,
database: D,
initial_file_size_threshold: i32
) -> Result<FileCenter, FileCenterError>
Create a new FileCenter instance with a custom initial file size threshold.
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 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.
pub fn drop_database(self) -> Result<(), FileCenterError>
[src]
Drop the database.
pub fn drop_file_center(self) -> Result<(), FileCenterError>
[src]
Drop the file center.
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_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_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_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.
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.
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.
pub fn clear_garbage(&self) -> Result<(), FileCenterError>
[src]
Remove all unused files in GridFS and in the COLLECTION_FILES_NAME
collection.
pub fn get_mongo_client_db(&self) -> &Database
[src]
Get the instance of MongoDB Database.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for FileCenter
impl Send for FileCenter
impl Sync for FileCenter
impl Unpin for FileCenter
impl UnwindSafe for FileCenter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,