Struct re_types_builder::Docs
source · pub struct Docs {
lines: Vec<(String, String)>,
}
Expand description
A high-level representation of the contents of a flatbuffer docstring.
Fields§
§lines: Vec<(String, String)>
All docmentation lines, including the leading tag, if any.
If the tag is the empty string, it means the line is untagged.
Each line excludes the leading space and trailing newline.
/// COMMENT\n
=>("", "COMMENT")
/// \py COMMENT\n
=>("py", "COMMENT")
.
Implementations§
source§impl Docs
impl Docs
pub fn from_raw_docs( reporter: &Reporter, virtpath: &str, fqname: &str, docs: Option<Vector<'_, ForwardsUOffset<&str>>>, ) -> Self
pub fn from_lines<'a>( reporter: &Reporter, virtpath: &str, fqname: &str, lines: impl Iterator<Item = &'a str>, ) -> Self
sourcepub fn first_line(
&self,
reporter: &Reporter,
objects: &Objects,
target: Target,
) -> Option<String>
pub fn first_line( &self, reporter: &Reporter, objects: &Objects, target: Target, ) -> Option<String>
Get the first line of the documentation untagged.
sourcepub fn only_lines_tagged(&self, tag: &str) -> Vec<&str>
pub fn only_lines_tagged(&self, tag: &str) -> Vec<&str>
Get all doc lines that start with the given tag.
For instance, pass "example"
to get all lines that start with "\example"
.
sourcepub(crate) fn lines_for(
&self,
reporter: &Reporter,
objects: &Objects,
target: Target,
) -> Vec<String>
pub(crate) fn lines_for( &self, reporter: &Reporter, objects: &Objects, target: Target, ) -> Vec<String>
Get all doc lines that are untagged, or has a tag matching the given target.
For instance, pass Target::Python
to get all lines that are untagged or starts with "\py"
.
The tagged lines (\py
) are left as is, but untagged lines will have Rerun doclinks translated to the target language.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Docs
impl RefUnwindSafe for Docs
impl Send for Docs
impl Sync for Docs
impl Unpin for Docs
impl UnwindSafe for Docs
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
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.