struct ParsedToken<'tok> {
kind: TokenKind,
value: &'tok str,
}Expand description
Nicer version of bindgen::callbacks::Token that stores the values as
readable strings.
Fields§
§kind: TokenKindToken kind, from bindgen.
value: &'tok strToken content, from parsing the bindgen value.
Implementations§
Source§impl<'tok> ParsedToken<'tok>
impl<'tok> ParsedToken<'tok>
Sourcefn from_raw(token: &'tok Token) -> Result<Self, Utf8Error>
fn from_raw(token: &'tok Token) -> Result<Self, Utf8Error>
Try to create a ParsedToken from a bindgen::callbacks::Token.
Sourcefn trim_wrapping_parens(tokens: &mut Vec<ParsedToken<'tok>>)
fn trim_wrapping_parens(tokens: &mut Vec<ParsedToken<'tok>>)
If the overall tokens start with an opening parenthesis and end with the closing parenthesis that matches that opening, remove both the opening and the closing.
Trait Implementations§
Source§impl<'tok> Clone for ParsedToken<'tok>
impl<'tok> Clone for ParsedToken<'tok>
Source§impl<'tok> Debug for ParsedToken<'tok>
impl<'tok> Debug for ParsedToken<'tok>
impl<'tok> Eq for ParsedToken<'tok>
Source§impl<'tok> PartialEq for ParsedToken<'tok>
impl<'tok> PartialEq for ParsedToken<'tok>
impl<'tok> StructuralPartialEq for ParsedToken<'tok>
Auto Trait Implementations§
impl<'tok> Forget for ParsedToken<'tok>
impl<'tok> Freeze for ParsedToken<'tok>
impl<'tok> Move for ParsedToken<'tok>
impl<'tok> RefUnwindSafe for ParsedToken<'tok>
impl<'tok> Send for ParsedToken<'tok>
impl<'tok> Sync for ParsedToken<'tok>
impl<'tok> Unpin for ParsedToken<'tok>
impl<'tok> UnsafeUnpin for ParsedToken<'tok>
impl<'tok> UnwindSafe for ParsedToken<'tok>
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