pub struct StringSource<C: CharType> {
pub source: Option<Ptr<String>>,
/* private fields */
}
Expand description
A StringSource
is the primary TokenSource
for TeX, which reads from a String
Fields§
§source: Option<Ptr<String>>
Implementations§
Source§impl<C: CharType> StringSource<C>
impl<C: CharType> StringSource<C>
Sourcepub fn new(string: Vec<u8>, source: Option<Ptr<String>>) -> StringSource<C>
pub fn new(string: Vec<u8>, source: Option<Ptr<String>>) -> StringSource<C>
Create a new StringSource
from a String
and an optional source reference.
source
is usually a filename, used to construct crate::tex::token::SourceReference
s for Token
s.
The StringSource
keeps track of the current line and column number.
pub fn line(&self) -> usize
pub fn column(&self) -> usize
pub fn preview(&self) -> String
pub fn get_next<T: Token<Char = C>>( &mut self, cc: &CategoryCodeScheme<C>, endline: Option<C>, ) -> Result<Option<T>, InvalidCharacter<T>>
Auto Trait Implementations§
impl<C> Freeze for StringSource<C>
impl<C> RefUnwindSafe for StringSource<C>where
C: RefUnwindSafe,
impl<C> !Send for StringSource<C>
impl<C> !Sync for StringSource<C>
impl<C> Unpin for StringSource<C>where
C: Unpin,
impl<C> UnwindSafe for StringSource<C>where
C: UnwindSafe,
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