pub struct RawStringSource(/* private fields */);Expand description
A string variant of RawSource.
use rustbolt_sources::{MapOptions, RawStringSource, Source};
let code = "some source code";
let s = RawStringSource::from(code.to_string());
assert_eq!(s.source(), code);
assert_eq!(s.map(&MapOptions::default()), None);
assert_eq!(s.size(), 16);Implementations§
Source§impl RawStringSource
impl RawStringSource
Sourcepub fn from_static(s: &'static str) -> Self
pub fn from_static(s: &'static str) -> Self
Create a new RawStringSource from a static &str.
use rustbolt_sources::{RawStringSource, Source};
let code = "some source code";
let s = RawStringSource::from_static(code);
assert_eq!(s.source(), code);Trait Implementations§
Source§impl Clone for RawStringSource
impl Clone for RawStringSource
Source§fn clone(&self) -> RawStringSource
fn clone(&self) -> RawStringSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RawStringSource
impl Debug for RawStringSource
Source§impl From<&str> for RawStringSource
impl From<&str> for RawStringSource
Source§impl From<String> for RawStringSource
impl From<String> for RawStringSource
Source§impl Hash for RawStringSource
impl Hash for RawStringSource
Source§impl PartialEq for RawStringSource
impl PartialEq for RawStringSource
Source§impl Source for RawStringSource
impl Source for RawStringSource
Source§impl StreamChunks for RawStringSource
impl StreamChunks for RawStringSource
Source§fn stream_chunks<'a>(
&'a self,
options: &MapOptions,
on_chunk: OnChunk<'_, 'a>,
on_source: OnSource<'_, 'a>,
on_name: OnName<'_, 'a>,
) -> GeneratedInfo
fn stream_chunks<'a>( &'a self, options: &MapOptions, on_chunk: OnChunk<'_, 'a>, on_source: OnSource<'_, 'a>, on_name: OnName<'_, 'a>, ) -> GeneratedInfo
StreamChunks abstraction
impl Eq for RawStringSource
impl StructuralPartialEq for RawStringSource
Auto Trait Implementations§
impl Freeze for RawStringSource
impl RefUnwindSafe for RawStringSource
impl Send for RawStringSource
impl Sync for RawStringSource
impl Unpin for RawStringSource
impl UnwindSafe for RawStringSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more