Struct git_config::parser::ParsedComment
source · [−]Expand description
A parsed comment event containing the comment marker and comment.
Fields
comment_tag: char
The comment marker used. This is either a semicolon or octothorpe.
comment: Cow<'a, [u8]>
The parsed comment.
Implementations
sourceimpl ParsedComment<'_>
impl ParsedComment<'_>
sourcepub fn to_owned(&self) -> ParsedComment<'static>
pub fn to_owned(&self) -> ParsedComment<'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 ParsedComment<'a>
impl<'a> Clone for ParsedComment<'a>
sourcefn clone(&self) -> ParsedComment<'a>
fn clone(&self) -> ParsedComment<'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 ParsedComment<'a>
impl<'a> Debug for ParsedComment<'a>
sourceimpl<'a> Default for ParsedComment<'a>
impl<'a> Default for ParsedComment<'a>
sourcefn default() -> ParsedComment<'a>
fn default() -> ParsedComment<'a>
Returns the “default value” for a type. Read more
sourceimpl Display for ParsedComment<'_>
impl Display for ParsedComment<'_>
sourceimpl From<&'_ ParsedComment<'_>> for Vec<u8>
impl From<&'_ ParsedComment<'_>> for Vec<u8>
sourcefn from(c: &ParsedComment<'_>) -> Self
fn from(c: &ParsedComment<'_>) -> Self
Converts to this type from the input type.
sourceimpl From<ParsedComment<'_>> for Vec<u8>
impl From<ParsedComment<'_>> for Vec<u8>
sourcefn from(c: ParsedComment<'_>) -> Self
fn from(c: ParsedComment<'_>) -> Self
Converts to this type from the input type.
sourceimpl<'a> Hash for ParsedComment<'a>
impl<'a> Hash for ParsedComment<'a>
sourceimpl<'a> Ord for ParsedComment<'a>
impl<'a> Ord for ParsedComment<'a>
sourceimpl<'a> PartialEq<ParsedComment<'a>> for ParsedComment<'a>
impl<'a> PartialEq<ParsedComment<'a>> for ParsedComment<'a>
sourcefn eq(&self, other: &ParsedComment<'a>) -> bool
fn eq(&self, other: &ParsedComment<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ParsedComment<'a>) -> bool
fn ne(&self, other: &ParsedComment<'a>) -> bool
This method tests for !=
.
sourceimpl<'a> PartialOrd<ParsedComment<'a>> for ParsedComment<'a>
impl<'a> PartialOrd<ParsedComment<'a>> for ParsedComment<'a>
sourcefn partial_cmp(&self, other: &ParsedComment<'a>) -> Option<Ordering>
fn partial_cmp(&self, other: &ParsedComment<'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 ParsedComment<'a>
impl<'a> StructuralEq for ParsedComment<'a>
impl<'a> StructuralPartialEq for ParsedComment<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for ParsedComment<'a>
impl<'a> Send for ParsedComment<'a>
impl<'a> Sync for ParsedComment<'a>
impl<'a> Unpin for ParsedComment<'a>
impl<'a> UnwindSafe for ParsedComment<'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