pub struct PdfString {
pub data: IBytes,
}
Expand description
Primitive String type.
Fields§
§data: IBytes
Implementations§
source§impl PdfString
impl PdfString
pub fn new(data: IBytes) -> PdfString
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn into_bytes(self) -> IBytes
sourcepub fn to_string_lossy(&self) -> String
pub fn to_string_lossy(&self) -> String
without encoding information the PdfString cannot be decoded into a String therefore only lossy decoding is possible replacing unknown characters. For decoding correctly see pdf_tools/src/lib.rs
Trait Implementations§
source§impl DataSize for PdfString
impl DataSize for PdfString
source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
If
true
, the type has a heap size that can vary at runtime, depending on the actual value.source§const STATIC_HEAP_SIZE: usize = 24usize
const STATIC_HEAP_SIZE: usize = 24usize
The amount of space a value of the type always occupies. If
IS_DYNAMIC
is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Estimates the size of heap memory taken up by this value. Read more
source§impl DeepClone for PdfString
impl DeepClone for PdfString
fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self>
source§impl ObjectWrite for PdfString
impl ObjectWrite for PdfString
source§impl PartialEq for PdfString
impl PartialEq for PdfString
impl Eq for PdfString
impl StructuralEq for PdfString
impl StructuralPartialEq for PdfString
Auto Trait Implementations§
impl RefUnwindSafe for PdfString
impl Send for PdfString
impl Sync for PdfString
impl Unpin for PdfString
impl UnwindSafe for PdfString
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.