Struct couchdb::EmbeddedAttachment [] [src]

pub struct EmbeddedAttachment {
    pub content_type: Mime,
    pub data: Option<Vec<u8>>,
    pub revpos: u64,
    // some fields omitted
}

An embedded attachment is an attachment contained within a document.

Broadly speaking, CouchDB provides two ways of accessing an attachment:

By default, an embedded attachment is a stub containing only meta-information about the attachment, but the attachment can be made to also contain its content via the attachments query parameter of the GetDocument action.

Fields

content_type

The content type is the MIME type describing the attachment's content.

data

The data field is the attachment's full content.

This field is Some only if the attachment is not a stub and instead contains its content. By default, an embedded attachment is a stub and does not contain its content.

Note that embedded attachments encode their content using Base64 during transmission as a JSON object over HTTP. This leads to a lot of overhead for large attachments.

revpos

The revision position is the revision number of the attachment's document when the attachment was added.

Trait Implementations

impl Deserialize for EmbeddedAttachment

fn deserialize<D>(deserializer: &mut D) -> Result<Self, D::Error> where D: Deserializer

Derived Implementations

impl PartialEq for EmbeddedAttachment

fn eq(&self, __arg_0: &EmbeddedAttachment) -> bool

fn ne(&self, __arg_0: &EmbeddedAttachment) -> bool

impl Debug for EmbeddedAttachment

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl Clone for EmbeddedAttachment

fn clone(&self) -> EmbeddedAttachment

fn clone_from(&mut self, source: &Self)