pub struct BuildWarning {
pub file: PathBuf,
pub line: Option<usize>,
pub message: String,
pub warning_type: WarningType,
pub category: Option<String>,
}Fields§
§file: PathBuf§line: Option<usize>§message: String§warning_type: WarningType§category: Option<String>Sphinx’s type.subtype warning category (toc.not_readable,
toc.not_included, …), which show_warning_types — on by default
since Sphinx 8.3 — appends to the rendered message as [category].
None for warnings Sphinx logs without a type (its
SphinxLoggerAdapter only appends the suffix when type is set, so
a subtype-only warning such as the toctree empty_glob one prints
bare). See util/logging.py:545-549.
Implementations§
Source§impl BuildWarning
impl BuildWarning
pub fn new( file: PathBuf, line: Option<usize>, message: String, warning_type: WarningType, ) -> Self
Sourcepub fn with_category(self, category: Option<String>) -> Self
pub fn with_category(self, category: Option<String>) -> Self
Attach Sphinx’s type.subtype category (see BuildWarning::category).
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
The warning as sphinx-build prints it:
path[:line]: WARNING: message[ [type.subtype]].
One renderer for every sink (stderr, -w warning file, the
environment-oracle differential) so a message can only ever be
formatted one way.
An empty file is a warning Sphinx logs with no location at all
(the intersphinx “failed to reach any of the inventories” report, for
one): those print as a bare WARNING: ..., with no location prefix
and no stray colon.
pub fn broken_cross_reference( file: PathBuf, line: Option<usize>, reference: &str, ) -> Self
Trait Implementations§
Source§impl Clone for BuildWarning
impl Clone for BuildWarning
Source§fn clone(&self) -> BuildWarning
fn clone(&self) -> BuildWarning
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BuildWarning
impl RefUnwindSafe for BuildWarning
impl Send for BuildWarning
impl Sync for BuildWarning
impl Unpin for BuildWarning
impl UnsafeUnpin for BuildWarning
impl UnwindSafe for BuildWarning
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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