pub struct Source { /* private fields */ }Expand description
A source of Roan code.
Implementations§
Source§impl Source
impl Source
Sourcepub fn from_string(string: String) -> Self
pub fn from_string(string: String) -> Self
Creates a new Source from a String.
Sourcepub fn from_bytes<T: AsRef<[u8]> + ?Sized>(source: &T) -> Self
pub fn from_bytes<T: AsRef<[u8]> + ?Sized>(source: &T) -> Self
Creates a new Source from a byte slice.
Sourcepub fn get_between(&self, start: usize, end: usize) -> String
pub fn get_between(&self, start: usize, end: usize) -> String
Returns the content of this Source between the specified indices.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnwindSafe for Source
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