pub struct MappedText {
pub text: String,
pub map: SourceMap,
}Expand description
Workshop text together with the SourceMap of its authored origin: the
workshop-rs/mapped-text-v1 artifact.
Fields§
§text: StringThe Workshop text, itself a workshop-rs/text-v1 artifact.
map: SourceMapThe mapping from the program parsed from text to the
authored source.
Implementations§
Source§impl MappedText
impl MappedText
Sourcepub fn from_json(json: &str) -> Result<Self, SourceMapError>
pub fn from_json(json: &str) -> Result<Self, SourceMapError>
Decode a workshop-rs/mapped-text-v1 JSON document.
Decoding checks the format and structure only; SourceMap::apply
validates the mapping against the program it is applied to.
Trait Implementations§
Source§impl Clone for MappedText
impl Clone for MappedText
Source§impl Debug for MappedText
impl Debug for MappedText
impl Eq for MappedText
Source§impl PartialEq for MappedText
impl PartialEq for MappedText
impl StructuralPartialEq for MappedText
Auto Trait Implementations§
impl Freeze for MappedText
impl RefUnwindSafe for MappedText
impl Send for MappedText
impl Sync for MappedText
impl Unpin for MappedText
impl UnsafeUnpin for MappedText
impl UnwindSafe for MappedText
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