[−][src]Struct lol_html::MemorySettings
Specifies the memory settings for HtmlRewriter.
Fields
preallocated_parsing_buffer_size: usizeSpecifies the number of bytes that should be preallocated on HtmlRewriter instantiation
for the internal parsing buffer.
In some cases (e.g. when rewriter encounters a start tag represented by two or more input chunks) the rewriter needs to buffer input content.
Internal parsing buffer is used in such cases. Reallocations and, thus, performance degradation can be avoided by preallocating the buffer ahead of time. As a drawback of this approach, every instance of the rewriter will consume the preallocated amount of memory.
It's up to the user to adjust the limit according to their environment limitations.
Default
1024 bytes when constructed with MemorySettings::default().
max_allowed_memory_usage: usizeSets a hard limit in bytes on memory consumption of a HtmlRewriter instance.
Rewriter's write and end methods will error if this limit is exceeded.
Note, that value doesn't reflect the exact threshold after which the rewriter will bailout. It is impossible to account for all the memory consumed without a significant performance penalty. So, instead, we try to provide the best approximation by measuring the memory consumed by internal buffers that grow depending on the input.
Default
std::usize::MAX when constructed with MemorySettings::default().
Trait Implementations
impl Default for MemorySettings[src]
Auto Trait Implementations
impl Send for MemorySettings
impl Sync for MemorySettings
impl Unpin for MemorySettings
impl UnwindSafe for MemorySettings
impl RefUnwindSafe for MemorySettings
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,