[][src]Struct mongodb::gridfs::file::GfsFile

pub struct GfsFile {
    pub id: ObjectId,
    pub chunk_size: i32,
    pub aliases: Vec<String>,
    pub name: Option<String>,
    pub upload_date: Option<DateTime<Utc>>,
    pub content_type: Option<String>,
    pub metadata: Option<Vec<u8>>,
    // some fields omitted
}

A one-to-one representation of a file document within GridFS.

Fields

id: ObjectIdchunk_size: i32aliases: Vec<String>name: Option<String>upload_date: Option<DateTime<Utc>>content_type: Option<String>metadata: Option<Vec<u8>>

Methods

impl GfsFile[src]

pub fn new(id: ObjectId) -> GfsFile[src]

Create a new GfsFile by ObjectId.

pub fn with_name(name: String, id: ObjectId) -> GfsFile[src]

Create a new GfsFile by filename and ObjectId.

pub fn with_doc(doc: Document) -> GfsFile[src]

Read a GridFS file document into a new GfsFile.

pub fn to_bson(&self) -> Document[src]

Converts a GfsFile into a bson document.

Trait Implementations

impl Debug for GfsFile[src]

Auto Trait Implementations

impl Unpin for GfsFile

impl Sync for GfsFile

impl Send for GfsFile

impl UnwindSafe for GfsFile

impl RefUnwindSafe for GfsFile

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self