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]
impl GfsFilepub fn new(id: ObjectId) -> GfsFile[src]
pub fn new(id: ObjectId) -> GfsFileCreate a new GfsFile by ObjectId.
pub fn with_name(name: String, id: ObjectId) -> GfsFile[src]
pub fn with_name(name: String, id: ObjectId) -> GfsFileCreate a new GfsFile by filename and ObjectId.
pub fn with_doc(doc: Document) -> GfsFile[src]
pub fn with_doc(doc: Document) -> GfsFileRead a GridFS file document into a new GfsFile.
pub fn to_bson(&self) -> Document[src]
pub fn to_bson(&self) -> DocumentConverts a GfsFile into a bson document.