pub struct ParseLogWarning {
pub source: u16,
pub message: String,
pub line: u32,
pub doc2path_location: bool,
}Expand description
One logger.warning a directive raised during the parse.
Producers: Cmdoption.handle_signature’s malformed option description
(domains/std/__init__.py:237-245) and — since wave 4.5 — the three
literalinclude reader warnings ([INC §3.4]). All are logged with no
type/subtype and so render with no [category] suffix.
Fields§
§source: u16Source-table index of the location= node’s line: the replay
renders this source’s path, not the document’s. Deliberately not
#[serde(default)] (cache-shape rule, see
RegistryExport::program_options).
message: StringThe warning text, already formatted exactly as Sphinx renders it.
line: u321-based line of the location= node Sphinx passes.
doc2path_location: boolWhen true, the rendered location appends the first source suffix to
the source path (see Self::rendered_path). Not
#[serde(default)] (cache-shape rule, see
RegistryExport::program_options): a pre-wave-4.5 cache entry
must MISS, not decode with the flag silently off.
Implementations§
Source§impl ParseLogWarning
impl ParseLogWarning
Sourcepub fn rendered_path(&self, source_path: &str) -> String
pub fn rendered_path(&self, source_path: &str) -> String
The path the rendered warning line spells for this record’s source table path.
WHY the doubled suffix: a Sphinx logger.warning(..., location=(source, line)) tuple is treated by the log translator as
(docname, lineno) and rendered f'{env.doc2path(docname)}:{lineno}'
(SP/util/logging.py:507-512); doc2path on a string that is not a
known docname appends the project’s first source suffix
(SP/project.py:114-128). The three literalinclude reader warnings
pass a full path like <srcdir>/a.rst as the tuple’s source, so
Sphinx renders the doubled <srcdir>/a.rst.rst — byte-exact oracle
behavior (probed, [INC §3.4]), reproduced here on replay. The
appended suffix is the crate’s first source suffix (.rst, matching
sphinx’s default source_suffix[0] and this crate’s discovery
order).
Trait Implementations§
Source§impl Clone for ParseLogWarning
impl Clone for ParseLogWarning
Source§fn clone(&self) -> ParseLogWarning
fn clone(&self) -> ParseLogWarning
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParseLogWarning
impl Debug for ParseLogWarning
Source§impl<'de> Deserialize<'de> for ParseLogWarning
impl<'de> Deserialize<'de> for ParseLogWarning
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ParseLogWarning
impl RefUnwindSafe for ParseLogWarning
impl Send for ParseLogWarning
impl Sync for ParseLogWarning
impl Unpin for ParseLogWarning
impl UnsafeUnpin for ParseLogWarning
impl UnwindSafe for ParseLogWarning
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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