pub struct Source { /* private fields */ }Expand description
A source of Roan code.
Implementations§
Source§impl Source
impl Source
Sourcepub fn from_string(string: String) -> Source
pub fn from_string(string: String) -> Source
Creates a new Source from a String.
Sourcepub fn from_bytes<T>(source: &T) -> Source
pub fn from_bytes<T>(source: &T) -> Source
Creates a new Source from a byte slice.
Sourcepub fn from_path(path: PathBuf) -> Result<Source, Error>
pub fn from_path(path: PathBuf) -> Result<Source, Error>
Creates a new Source from a file path.
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