pub enum NormalModule {
Owned(Box<NormalModuleInner>),
Transferred,
}Variants§
Owned(Box<NormalModuleInner>)
Transferred
Implementations§
Source§impl NormalModule
impl NormalModule
pub fn new( request: String, user_request: String, raw_request: String, module_type: impl Into<ModuleType>, layer: Option<ModuleLayer>, parser_and_generator: Box<dyn ParserAndGenerator>, parser_options: Option<ParserOptions>, generator_options: Option<GeneratorOptions>, match_resource: Option<ResourceData>, resource_data: Arc<ResourceData>, resolve_options: Option<Arc<Resolve>>, loaders: Vec<BoxLoader>, context: Option<Context>, extract_source_map: Option<bool>, ) -> Self
pub fn id(&self) -> ModuleIdentifier
pub fn match_resource(&self) -> Option<&ResourceData>
pub fn match_resource_mut(&mut self) -> &mut Option<ResourceData>
pub fn resource_resolved_data(&self) -> &Arc<ResourceData>
pub fn request(&self) -> &str
pub fn user_request(&self) -> &str
pub fn user_request_mut(&mut self) -> &mut String
pub fn raw_request(&self) -> &str
pub fn loaders(&self) -> &[BoxLoader] ⓘ
pub fn parser_and_generator(&self) -> &dyn ParserAndGenerator
pub fn parser_and_generator_mut(&mut self) -> &mut Box<dyn ParserAndGenerator>
pub fn code_generation_dependencies(&self) -> &Option<Vec<BoxModuleDependency>>
pub fn code_generation_dependencies_mut( &mut self, ) -> &mut Option<Vec<BoxModuleDependency>>
pub fn presentational_dependencies(&self) -> &Option<Vec<BoxDependencyTemplate>>
pub fn presentational_dependencies_mut( &mut self, ) -> &mut Option<Vec<BoxDependencyTemplate>>
pub fn get_parser_options(&self) -> Option<&ParserOptions>
pub fn get_generator_options(&self) -> Option<&GeneratorOptions>
Trait Implementations§
Source§impl Archive for NormalModule
impl Archive for NormalModule
Source§type Archived = ArchivedNormalModule
type Archived = ArchivedNormalModule
The archived representation of this type. Read more
Source§type Resolver = NormalModuleResolver
type Resolver = NormalModuleResolver
The resolver for this type. It must contain all the additional
information from serializing needed to make the archived type from
the normal type.
Source§fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
fn resolve(&self, resolver: Self::Resolver, out: Place<Self::Archived>)
Creates the archived version of this value at the given position and
writes it to the given output. Read more
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
An optimization flag that allows the bytes of this type to be copied
directly to a writer instead of calling
serialize. Read moreSource§impl Debug for NormalModule
impl Debug for NormalModule
Source§impl DependenciesBlock for NormalModule
impl DependenciesBlock for NormalModule
fn add_block_id(&mut self, block: AsyncDependenciesBlockIdentifier)
fn get_blocks(&self) -> &[AsyncDependenciesBlockIdentifier]
fn add_dependency_id(&mut self, dependency: DependencyId)
fn remove_dependency_id(&mut self, dependency: DependencyId)
fn get_dependencies(&self) -> &[DependencyId]
Source§impl<__D: Fallible + ?Sized> Deserialize<NormalModule, __D> for Archived<NormalModule>where
Box<NormalModuleInner>: Archive,
<Box<NormalModuleInner> as Archive>::Archived: Deserialize<Box<NormalModuleInner>, __D>,
impl<__D: Fallible + ?Sized> Deserialize<NormalModule, __D> for Archived<NormalModule>where
Box<NormalModuleInner>: Archive,
<Box<NormalModuleInner> as Archive>::Archived: Deserialize<Box<NormalModuleInner>, __D>,
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<NormalModule, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<NormalModule, <__D as Fallible>::Error>
Deserializes using the given deserializer
Source§impl Diagnosable for NormalModule
impl Diagnosable for NormalModule
fn add_diagnostic(&mut self, diagnostic: Diagnostic)
fn add_diagnostics(&mut self, diagnostics: Vec<Diagnostic>)
fn diagnostics(&self) -> Cow<'_, [Diagnostic]>
fn first_error(&self) -> Option<Cow<'_, Diagnostic>>
Source§impl Identifiable for NormalModule
impl Identifiable for NormalModule
fn identifier(&self) -> ModuleIdentifier
Source§impl Module for NormalModule
impl Module for NormalModule
Source§fn module_type(&self) -> &ModuleType
fn module_type(&self) -> &ModuleType
Defines what kind of module this is.
Source§fn source_types(&self, module_graph: &ModuleGraph<'_>) -> &[SourceType]
fn source_types(&self, module_graph: &ModuleGraph<'_>) -> &[SourceType]
Defines what kind of code generation results this module can generate.
Source§fn source(&self) -> Option<&BoxSource>
fn source(&self) -> Option<&BoxSource>
The source of the module. This could be optional, modules like the
NormalModule can have the corresponding source.
However, modules that is created from “nowhere” (e.g. ExternalModule and MissingModule) does not have its source.Source§fn readable_identifier(&self, context: &Context) -> Cow<'_, str>
fn readable_identifier(&self, context: &Context) -> Cow<'_, str>
User readable identifier of the module.
Source§fn size(
&self,
source_type: Option<&SourceType>,
_compilation: Option<&Compilation>,
) -> f64
fn size( &self, source_type: Option<&SourceType>, _compilation: Option<&Compilation>, ) -> f64
The size of the original source, which will used as a parameter for code-splitting.
Only when calculating the size of the RuntimeModule is the Compilation depended on
Source§fn build<'life0, 'life1, 'async_trait>(
&'life0 mut self,
build_context: BuildContext,
_compilation: Option<&'life1 Compilation>,
) -> Pin<Box<dyn Future<Output = Result<BuildResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn build<'life0, 'life1, 'async_trait>(
&'life0 mut self,
build_context: BuildContext,
_compilation: Option<&'life1 Compilation>,
) -> Pin<Box<dyn Future<Output = Result<BuildResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
The actual build of the module, which will be called by the
Compilation.
Build can also returns the dependencies of the module, which will be used by the Compilation to build the dependency graph.Source§fn code_generation<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
compilation: &'life1 Compilation,
runtime: Option<&'life2 RuntimeSpec>,
concatenation_scope: Option<ConcatenationScope>,
) -> Pin<Box<dyn Future<Output = Result<CodeGenerationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn code_generation<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
compilation: &'life1 Compilation,
runtime: Option<&'life2 RuntimeSpec>,
concatenation_scope: Option<ConcatenationScope>,
) -> Pin<Box<dyn Future<Output = Result<CodeGenerationResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
The actual code generation of the module, which will be called by the
Compilation.
The code generation result should not be cached as it is implemented elsewhere to
provide a universal cache mechanism (time to invalidate cache, etc.) Read moreSource§fn get_runtime_hash<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
compilation: &'life1 Compilation,
runtime: Option<&'life2 RuntimeSpec>,
) -> Pin<Box<dyn Future<Output = Result<RspackHashDigest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_runtime_hash<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
compilation: &'life1 Compilation,
runtime: Option<&'life2 RuntimeSpec>,
) -> Pin<Box<dyn Future<Output = Result<RspackHashDigest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Update hash for cgm.hash (chunk graph module hash)
Different cgm code generation result should have different cgm.hash,
so this also accept compilation (mainly chunk graph) and runtime as args.
(Difference with
impl Hash for Module: this is just a part for calculating cgm.hash, not for Module itself)Source§fn name_for_condition(&self) -> Option<Box<str>>
fn name_for_condition(&self) -> Option<Box<str>>
Name matched against bundle-splitting conditions.
fn lib_ident(&self, options: LibIdentOptions<'_>) -> Option<Cow<'_, str>>
Source§fn get_resolve_options(&self) -> Option<Arc<Resolve>>
fn get_resolve_options(&self) -> Option<Arc<Resolve>>
Resolve options matched by module rules.
e.g
javascript/esm may have special resolving options like fullySpecified.
css and css/module may have special resolving options like preferRelative.Source§fn get_code_generation_dependencies(&self) -> Option<&[BoxModuleDependency]>
fn get_code_generation_dependencies(&self) -> Option<&[BoxModuleDependency]>
Code generation dependencies of the module, which means the code generation of this module
depends on the code generation results of dependencies which are returned by this function.
e.g
Css module may rely on the code generation result of CssUrlDependency to re-direct
the url of the referenced assets.fn get_presentational_dependencies(&self) -> Option<&[BoxDependencyTemplate]>
fn get_context(&self) -> Option<Box<Context>>
fn get_layer(&self) -> Option<&ModuleLayer>
fn get_side_effects_connection_state( &self, module_graph: &ModuleGraph<'_>, module_graph_cache: &ModuleGraphCacheArtifact, module_chain: &mut IdentifierSet, connection_state_cache: &mut IdentifierMap<ConnectionState>, ) -> ConnectionState
fn get_concatenation_bailout_reason( &self, mg: &ModuleGraph<'_>, cg: &ChunkGraph, ) -> Option<Cow<'static, str>>
fn factory_meta(&self) -> Option<&FactoryMeta>
fn set_factory_meta(&mut self, factory_meta: FactoryMeta)
fn build_info(&self) -> &BuildInfo
fn build_info_mut(&mut self) -> &mut BuildInfo
fn build_meta(&self) -> &BuildMeta
fn build_meta_mut(&mut self) -> &mut BuildMeta
fn get_exports_argument(&self) -> ExportsArgument
fn get_module_argument(&self) -> ModuleArgument
fn get_exports_type( &self, module_graph: &ModuleGraph<'_>, module_graph_cache: &ModuleGraphCacheArtifact, strict: bool, ) -> ExportsType
fn get_strict_esm_module(&self) -> bool
fn chunk_condition( &self, _chunk_key: &ChunkUkey, _compilation: &Compilation, ) -> Option<bool>
fn need_build(&self, value_cache_version: &ValueCacheVersions) -> bool
fn need_id(&self) -> bool
Source§impl ModuleSourceMapConfig for NormalModule
impl ModuleSourceMapConfig for NormalModule
fn get_source_map_kind(&self) -> &SourceMapKind
fn set_source_map_kind(&mut self, source_map_kind: SourceMapKind)
Auto Trait Implementations§
impl Freeze for NormalModule
impl !RefUnwindSafe for NormalModule
impl Send for NormalModule
impl Sync for NormalModule
impl Unpin for NormalModule
impl !UnwindSafe for NormalModule
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§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> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
Creates the archived version of the metadata for this value.
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
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> IntoTWithDiagnosticArray for Twhere
T: Debug,
impl<T> IntoTWithDiagnosticArray for Twhere
T: Debug,
fn with_diagnostic(self, diagnostic: Vec<Diagnostic>) -> TWithDiagnosticArray<T>where
T: Debug,
fn with_empty_diagnostic(self) -> TWithDiagnosticArray<Self>
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Set the foreground color generically Read more
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Set the background color generically. Read more
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Change the foreground color to black
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Change the background color to black
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Change the foreground color to red
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Change the background color to red
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Change the foreground color to green
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Change the background color to green
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Change the foreground color to yellow
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Change the background color to yellow
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Change the foreground color to blue
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Change the background color to blue
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Change the foreground color to magenta
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Change the background color to magenta
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Change the foreground color to purple
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Change the background color to purple
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Change the foreground color to cyan
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Change the background color to cyan
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Change the foreground color to white
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Change the background color to white
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Change the foreground color to the terminal default
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Change the background color to the terminal default
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Change the foreground color to bright black
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Change the background color to bright black
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Change the foreground color to bright red
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Change the background color to bright red
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Change the foreground color to bright green
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Change the background color to bright green
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Change the foreground color to bright yellow
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Change the background color to bright yellow
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Change the foreground color to bright blue
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Change the background color to bright blue
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright magenta
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright magenta
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Change the foreground color to bright purple
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Change the background color to bright purple
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Change the foreground color to bright cyan
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Change the background color to bright cyan
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Change the foreground color to bright white
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Change the background color to bright white
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Make the text bold
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Make the text dim
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Make the text italicized
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Make the text underlined
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Make the text blink
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Make the text blink (but fast!)
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Swap the foreground and background colors
Hide the text
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Cross out the text
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the foreground color at runtime. Only use if you do not know which color will be used at
compile-time. If the color is constant, use either
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
Set the background color at runtime. Only use if you do not know what color to use at
compile-time. If the color is constant, use either
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read moreSource§fn fg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the foreground color to a specific RGB value.
Source§fn bg_rgb<const R: u8, const G: u8, const B: u8>(
&self,
) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>
Set the background color to a specific RGB value.
Source§fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>
Sets the foreground color to an RGB value.
Source§fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Sets the background color to an RGB value.
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> SerializeDyn for Twhere
T: for<'a> SerializeUnsized<Strategy<Serializer<AlignedVec, ArenaHandle<'a>, Share>, SerializeError>>,
impl<T> SerializeDyn for Twhere
T: for<'a> SerializeUnsized<Strategy<Serializer<AlignedVec, ArenaHandle<'a>, Share>, SerializeError>>,
Source§fn serialize_dyn(
&self,
serializer: &mut Strategy<Serializer<AlignedVec, ArenaHandle<'_>, Share>, SerializeError>,
) -> Result<usize, SerializeError>
fn serialize_dyn( &self, serializer: &mut Strategy<Serializer<AlignedVec, ArenaHandle<'_>, Share>, SerializeError>, ) -> Result<usize, SerializeError>
Writes the value to the serializer and returns the position it was written to.
Source§impl<T, S> SerializeUnsized<S> for T
impl<T, S> SerializeUnsized<S> for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref() only in debug builds, and is erased in release
builds.