pub enum MaybeRef<T> {
Direct(Shared<T>),
Indirect(RcRef<T>),
}
Variants§
Implementations§
Trait Implementations§
source§impl<T> DataSize for MaybeRef<T>where
Shared<T>: DataSize,
RcRef<T>: DataSize,
impl<T> DataSize for MaybeRef<T>where Shared<T>: DataSize, RcRef<T>: DataSize,
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 = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
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<T: DeepClone + Debug + DataSize + Object + ObjectWrite> DeepClone for MaybeRef<T>
impl<T: DeepClone + Debug + DataSize + Object + ObjectWrite> DeepClone for MaybeRef<T>
fn deep_clone(&self, cloner: &mut impl Cloner) -> Result<Self>
source§impl<T: ObjectWrite> ObjectWrite for MaybeRef<T>
impl<T: ObjectWrite> ObjectWrite for MaybeRef<T>
impl<T> Eq for MaybeRef<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for MaybeRef<T>where T: RefUnwindSafe,
impl<T> Send for MaybeRef<T>where T: Send + Sync,
impl<T> Sync for MaybeRef<T>where T: Send + Sync,
impl<T> Unpin for MaybeRef<T>
impl<T> UnwindSafe for MaybeRef<T>where T: RefUnwindSafe,
Blanket Implementations§
source§impl<T> Backend for Twhere
T: Deref<Target = [u8]>,
impl<T> Backend for Twhere T: Deref<Target = [u8]>,
fn read<R>(&self, range: R) -> Result<&[u8], PdfError>where R: IndexRange,
fn len(&self) -> usize
fn is_empty(&self) -> bool
source§fn locate_start_offset(&self) -> Result<usize>
fn locate_start_offset(&self) -> Result<usize>
Returns the offset of the beginning of the file, i.e., where the
%PDF-1.5
header is.
(currently only used internally!)source§fn locate_xref_offset(&self) -> Result<usize>
fn locate_xref_offset(&self) -> Result<usize>
Returns the value of startxref (currently only used internally!)
source§fn read_xref_table_and_trailer(
&self,
start_offset: usize,
resolve: &impl Resolve
) -> Result<(XRefTable, Dictionary)>
fn read_xref_table_and_trailer( &self, start_offset: usize, resolve: &impl Resolve ) -> Result<(XRefTable, Dictionary)>
Used internally by File, but could also be useful for applications that want to look at the raw PDF objects.
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.