Trait gmime::PartExt[][src]

pub trait PartExt {
    fn get_best_content_encoding(
        &self,
        constraint: EncodingConstraint
    ) -> ContentEncoding;
fn get_content(&self) -> Option<DataWrapper>;
fn get_content_description(&self) -> Option<String>;
fn get_content_encoding(&self) -> ContentEncoding;
fn get_content_location(&self) -> Option<String>;
fn get_content_md5(&self) -> Option<String>;
fn get_filename(&self) -> Option<String>;
fn get_openpgp_data(&self) -> OpenPGPData;
fn is_attachment(&self) -> bool;
fn openpgp_decrypt<'a, P: Into<Option<&'a str>>>(
        &self,
        flags: DecryptFlags,
        session_key: P
    ) -> Result<Option<DecryptResult>, Error>;
fn openpgp_sign(&self, userid: &str) -> Result<(), Error>;
fn openpgp_verify(
        &self,
        flags: VerifyFlags
    ) -> Result<Option<SignatureList>, Error>;
fn set_content(&self, content: &DataWrapper);
fn set_content_description(&self, description: &str);
fn set_content_encoding(&self, encoding: ContentEncoding);
fn set_content_location(&self, content_location: &str);
fn set_content_md5(&self, content_md5: &str);
fn set_filename(&self, filename: &str);
fn set_openpgp_data(&self, data: OpenPGPData);
fn verify_content_md5(&self) -> bool; }

Trait containing all Part methods.

Implementors

ApplicationPkcs7Mime, MessagePartial, Part, TextPart

Required Methods

Calculates the most efficient content encoding for the self given the constraint.

constraint

a EncodingConstraint

Returns

the best content encoding for the specified mime part.

Gets the internal data-wrapper of the specified mime part, or None on error.

Returns

the data-wrapper for the mime part's contents.

Gets the value of the Content-Description for the specified mime part if it exists or None otherwise.

Returns

the content description for the specified mime part.

Gets the content encoding of the mime part.

Returns

the content encoding for the specified mime part.

Gets the value of the Content-Location header if it exists, or None otherwise.

Returns

the content location for the specified mime part.

Gets the md5sum contained in the Content-Md5 header of the specified mime part if it exists, or None otherwise.

Returns

the content md5 for the specified mime part.

Gets the filename of the specificed mime part, or None if the self does not have the filename or name parameter set.

Returns

the filename of the specified self or None if neither of the parameters is set. If a file name is set, the returned string will be in UTF-8.

Gets whether or not (and what type) of OpenPGP data is contained within the Part.

Returns

a OpenPGPData.

Determines whether or not the part is an attachment based on the value of the Content-Disposition header.

Returns

true if the part is an attachment, otherwise false.

Decrypts the content of the self and then replaces the content with the new, decrypted, content.

flags

a set of DecryptFlags

session_key

the session key to use or None

Returns

a DecryptResult on success or None on error.

Signs the content of the self and then replaces the content with the new, signed, content.

userid

the key id (or email address) to use for signing

Returns

true on success or false on error.

Verifies the OpenPGP signature of the self and then replaces the content with the original, raw, content.

flags

a set of VerifyFlags

Returns

a SignatureList on success or None on error.

Sets the content on the mime part.

content

a DataWrapper content object

Set the content description for the specified mime part.

description

content description

Set the content encoding for the specified mime part.

encoding

a ContentEncoding

Set the content location for the specified mime part.

content_location

content location

Set the content md5 for the specified mime part.

content_md5

content md5 or None to generate the md5 digest.

Sets the "filename" parameter on the Content-Disposition and also sets the "name" parameter on the Content-Type.

Note: The filename string should be in UTF-8.

filename

the file name

Sets whether or not (and what type) of OpenPGP data is contained within the Part.

data

a OpenPGPData

Verify the content md5 for the specified mime part.

Returns

true if the md5 is valid or false otherwise. Note: will return false if the mime part does not contain a Content-MD5.

Implementors