Struct git_config::parser::ParsedSection
source · [−]pub struct ParsedSection<'a> {
pub section_header: ParsedSectionHeader<'a>,
pub events: Vec<Event<'a>>,
}
Expand description
A parsed section containing the header and the section events.
Fields
section_header: ParsedSectionHeader<'a>
The section name and subsection name, if any.
events: Vec<Event<'a>>
The syntactic events found in this section.
Implementations
sourceimpl ParsedSection<'_>
impl ParsedSection<'_>
sourcepub fn to_owned(&self) -> ParsedSection<'static>
pub fn to_owned(&self) -> ParsedSection<'static>
Coerces into an owned instance. This differs from the standard clone
implementation as calling clone will not copy the borrowed variant,
while this method will. In other words:
Borrow type | .clone() | to_owned() |
---|---|---|
Borrowed | Borrowed | Owned |
Owned | Owned | Owned |
This can be most effectively seen by the differing lifetimes between the
two. This method guarantees a 'static
lifetime, while clone
does
not.
Trait Implementations
sourceimpl<'a> Clone for ParsedSection<'a>
impl<'a> Clone for ParsedSection<'a>
sourcefn clone(&self) -> ParsedSection<'a>
fn clone(&self) -> ParsedSection<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for ParsedSection<'a>
impl<'a> Debug for ParsedSection<'a>
sourceimpl<'a> Default for ParsedSection<'a>
impl<'a> Default for ParsedSection<'a>
sourcefn default() -> ParsedSection<'a>
fn default() -> ParsedSection<'a>
Returns the “default value” for a type. Read more
sourceimpl Display for ParsedSection<'_>
impl Display for ParsedSection<'_>
sourceimpl<'a> Hash for ParsedSection<'a>
impl<'a> Hash for ParsedSection<'a>
sourceimpl<'a> Ord for ParsedSection<'a>
impl<'a> Ord for ParsedSection<'a>
sourceimpl<'a> PartialEq<ParsedSection<'a>> for ParsedSection<'a>
impl<'a> PartialEq<ParsedSection<'a>> for ParsedSection<'a>
sourcefn eq(&self, other: &ParsedSection<'a>) -> bool
fn eq(&self, other: &ParsedSection<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ParsedSection<'a>) -> bool
fn ne(&self, other: &ParsedSection<'a>) -> bool
This method tests for !=
.
sourceimpl<'a> PartialOrd<ParsedSection<'a>> for ParsedSection<'a>
impl<'a> PartialOrd<ParsedSection<'a>> for ParsedSection<'a>
sourcefn partial_cmp(&self, other: &ParsedSection<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &ParsedSection<'a>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<'a> Eq for ParsedSection<'a>
impl<'a> StructuralEq for ParsedSection<'a>
impl<'a> StructuralPartialEq for ParsedSection<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for ParsedSection<'a>
impl<'a> Send for ParsedSection<'a>
impl<'a> Sync for ParsedSection<'a>
impl<'a> Unpin for ParsedSection<'a>
impl<'a> UnwindSafe for ParsedSection<'a>
Blanket Implementations
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> 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