#[non_exhaustive]pub enum OutputDestination {
File(String),
Writer(Box<dyn Write>),
Stdout,
}
Expand description
Output destination for HTML generation.
Specifies where the generated HTML content should be written.
§Examples
Writing HTML to a file:
use std::fs::File;
use html_generator::OutputDestination;
let output = OutputDestination::File("output.html".to_string());
Writing HTML to an in-memory buffer:
use std::io::Cursor;
use html_generator::OutputDestination;
let buffer = Cursor::new(Vec::new());
let output = OutputDestination::Writer(Box::new(buffer));
Writing HTML to standard output:
use html_generator::OutputDestination;
let output = OutputDestination::Stdout;
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
File(String)
Write output to a file at the specified path.
§Example
use html_generator::OutputDestination;
let output = OutputDestination::File("output.html".to_string());
Writer(Box<dyn Write>)
Write output using a custom writer implementation.
This can be used for in-memory buffers, network streams, or other custom output destinations.
§Example
use std::io::Cursor;
use html_generator::OutputDestination;
let buffer = Cursor::new(Vec::new());
let output = OutputDestination::Writer(Box::new(buffer));
Stdout
Write output to standard output (default).
This is useful for command-line tools and scripts.
§Example
use html_generator::OutputDestination;
let output = OutputDestination::Stdout;
Trait Implementations§
Source§impl Debug for OutputDestination
Debug implementation for OutputDestination.
impl Debug for OutputDestination
Debug implementation for OutputDestination.
Source§impl Default for OutputDestination
Default implementation for OutputDestination.
impl Default for OutputDestination
Default implementation for OutputDestination.
Auto Trait Implementations§
impl Freeze for OutputDestination
impl !RefUnwindSafe for OutputDestination
impl !Send for OutputDestination
impl !Sync for OutputDestination
impl Unpin for OutputDestination
impl !UnwindSafe for OutputDestination
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more