Struct mongodb::gridfs::file::GfsFile
[−]
[src]
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: ObjectId
chunk_size: i32
aliases: Vec<String>
name: Option<String>
upload_date: Option<DateTime<UTC>>
content_type: Option<String>
metadata: Option<Vec<u8>>
Methods
impl GfsFile
[src]
fn new(id: ObjectId) -> GfsFile
Create a new GfsFile by ObjectId.
fn with_name(name: String, id: ObjectId) -> GfsFile
Create a new GfsFile by filename and ObjectId.
fn with_doc(doc: Document) -> GfsFile
Read a GridFS file document into a new GfsFile.
fn to_bson(&self) -> Document
Converts a GfsFile into a bson document.