Trait gmime::MultipartExt [−][src]
pub trait MultipartExt { fn add<P: IsA<Object>>(&self, part: &P); fn clear(&self); fn contains<P: IsA<Object>>(&self, part: &P) -> bool; fn get_boundary(&self) -> Option<String>; fn get_count(&self) -> i32; fn get_epilogue(&self) -> Option<String>; fn get_part(&self, index: i32) -> Option<Object>; fn get_prologue(&self) -> Option<String>; fn get_subpart_from_content_id(&self, content_id: &str) -> Option<Object>; fn index_of<P: IsA<Object>>(&self, part: &P) -> i32; fn insert<P: IsA<Object>>(&self, index: i32, part: &P); fn remove<P: IsA<Object>>(&self, part: &P) -> bool; fn remove_at(&self, index: i32) -> Option<Object>; fn replace<P: IsA<Object>>(
&self,
index: i32,
replacement: &P
) -> Option<Object>; fn set_boundary(&self, boundary: &str); fn set_epilogue(&self, epilogue: &str); fn set_prologue(&self, prologue: &str); }
Required Methods
fn add<P: IsA<Object>>(&self, part: &P)
fn clear(&self)
Removes all subparts from self
.
fn contains<P: IsA<Object>>(&self, part: &P) -> bool
Checks if part
is contained within self
.
part
a Object
Returns
true
if part
is a subpart of self
or false
otherwise.
fn get_boundary(&self) -> Option<String>
Gets the boundary on the multipart. If the internal boundary is
None
, then an auto-generated boundary will be set on the multipart
and returned.
Returns
the boundary on the multipart.
fn get_count(&self) -> i32
fn get_epilogue(&self) -> Option<String>
fn get_part(&self, index: i32) -> Option<Object>
Gets the part at the specified index
within the multipart.
index
the 0-based index of the part
Returns
the part at position index
.
fn get_prologue(&self) -> Option<String>
fn get_subpart_from_content_id(&self, content_id: &str) -> Option<Object>
Gets the mime part with the content-id content_id
from the
multipart self
.
content_id
the content id of the part to look for
Returns
the Object
whose content-id matches
the search string, or None
if a match cannot be found.
fn index_of<P: IsA<Object>>(&self, part: &P) -> i32
Gets the 0-based index of part
within self
.
part
a Object
Returns
the 0-based index of part
within self
or %-1 if not found.
fn insert<P: IsA<Object>>(&self, index: i32, part: &P)
Inserts part
into self
at the specified index
.
index
the 0-based index to insert the part
part
a Object
fn remove<P: IsA<Object>>(&self, part: &P) -> bool
Removes the specified part
from self
.
part
a Object
Returns
true
if the part was removed or false
otherwise.
fn remove_at(&self, index: i32) -> Option<Object>
Removes the part at the specified index
from self
.
index
the 0-based index of the part to remove
Returns
the mime part that was removed or None
if the part was not contained within the multipart.
fn replace<P: IsA<Object>>(&self, index: i32, replacement: &P) -> Option<Object>
Replaces the part at the specified index
within self
with
replacement
.
index
the 0-based index of the part to replace
replacement
a Object
to use as the replacement
Returns
the part that was replaced or None
if the part was not contained within the multipart.
fn set_boundary(&self, boundary: &str)
Sets boundary
as the boundary on the multipart. If boundary
is
None
, then a boundary will be auto-generated for you.
boundary
boundary or None
to autogenerate one
fn set_epilogue(&self, epilogue: &str)
fn set_prologue(&self, prologue: &str)
Implementors
impl<O: IsA<Multipart>> MultipartExt for O