Expand description
The documentation provided by a user for a specific module, object, function, etc.
Fields
summary: String
The first line of a doc string. This has whitespace trimmed from it.
details: Option<String>
The contents of a doc string that follow the summary, and a single blank line. This also has whitespace trimmed from it, and it is dedented.
Implementations
sourceimpl DocString
impl DocString
sourcepub fn extract_raw_starlark_docstring<P: AstPayload>(
body: &Spanned<StmtP<P>>
) -> Option<String>
pub fn extract_raw_starlark_docstring<P: AstPayload>(
body: &Spanned<StmtP<P>>
) -> Option<String>
Extracts the docstring from a function or module body, iff the first statement is a string literal.
sourcepub fn from_docstring(
kind: DocStringKind,
user_docstring: &str
) -> Option<DocString>
pub fn from_docstring(
kind: DocStringKind,
user_docstring: &str
) -> Option<DocString>
Do common work to parse a docstring (dedenting, splitting summary and details, etc)
sourcepub fn parse_params(
kind: DocStringKind,
args_section: &str
) -> HashMap<String, String>
pub fn parse_params(
kind: DocStringKind,
args_section: &str
) -> HashMap<String, String>
Parse out parameter docs from an “Args:” section of a docstring
args_section
should be dedented, and generally should just be the args
key of
the DocString::parse_params()
function call. This is done as a separate function
to reduce the number of times that sections are parsed out of docstring (e.g. if
a user wants both the Args:
and Returns:
sections)
Trait Implementations
sourceimpl<'de> Deserialize<'de> for DocString
impl<'de> Deserialize<'de> for DocString
sourcefn 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>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for DocString
Auto Trait Implementations
impl RefUnwindSafe for DocString
impl Send for DocString
impl Sync for DocString
impl Unpin for DocString
impl UnwindSafe for DocString
Blanket Implementations
sourceimpl<T> AsARef<T> for T where
T: ?Sized,
impl<T> AsARef<T> for T where
T: ?Sized,
sourcefn try_as_aref(this: &T) -> Result<ARef<'_, T>, BorrowError>
fn try_as_aref(this: &T) -> Result<ARef<'_, T>, BorrowError>
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Serialize for T where
T: Serialize + ?Sized,
impl<T> Serialize for T where
T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more