#[non_exhaustive]pub struct RtfDocument {
pub header: RtfHeader,
pub info: DocumentInfo,
pub body: Vec<StyleBlock>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.header: RtfHeader§info: DocumentInfo§body: Vec<StyleBlock>Implementations§
Source§impl RtfDocument
impl RtfDocument
Sourcepub fn from_filepath(filename: &str) -> Result<RtfDocument, RtfError>
pub fn from_filepath(filename: &str) -> Result<RtfDocument, RtfError>
Create an RtfDocument from a rtf file path
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<RtfDocument, RtfError>
pub fn from_bytes(bytes: &[u8]) -> Result<RtfDocument, RtfError>
Create an RtfDocument from the bytes of an RTF file. UTF-8 input is read as is; any other
input is read in the code page the document declares.
pub fn get_text_with(&self, options: TextOptions) -> String
Trait Implementations§
Source§impl Clone for RtfDocument
impl Clone for RtfDocument
Source§impl Debug for RtfDocument
impl Debug for RtfDocument
Source§impl Default for RtfDocument
impl Default for RtfDocument
Source§impl<'de> Deserialize<'de> for RtfDocument
impl<'de> Deserialize<'de> for RtfDocument
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RtfDocument
impl PartialEq for RtfDocument
Source§impl Serialize for RtfDocument
impl Serialize for RtfDocument
impl StructuralPartialEq for RtfDocument
Source§impl TryFrom<&mut File> for RtfDocument
impl TryFrom<&mut File> for RtfDocument
Source§impl TryFrom<&str> for RtfDocument
impl TryFrom<&str> for RtfDocument
Auto Trait Implementations§
impl Freeze for RtfDocument
impl RefUnwindSafe for RtfDocument
impl Send for RtfDocument
impl Sync for RtfDocument
impl Unpin for RtfDocument
impl UnsafeUnpin for RtfDocument
impl UnwindSafe for RtfDocument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more