pub enum TextRepr {
Markdown,
String,
Object {
language_key: String,
content_key: String,
},
Error,
}Expand description
How to represent text with non-plaintext language in a data model.
This controls how Text values with Language::Other(lang) are serialized
to formats that don’t natively support language-tagged text.
Corresponds to the $text-repr extension (formerly $code-repr).
Variants§
Markdown
Markdown code block string.
e.g. “rust\nfn main() { println!(\"Hello, world!\"); }\n”.
String
Content only string, discarding language information. e.g. “fn main() { println!("Hello, world!"); }”.
Object
Object with language and content fields.
e.g. {"language": "rust", "content": "fn main() { println!(\"Hello, world!\"); }"}.
Error
Error on conversion.
Trait Implementations§
impl StructuralPartialEq for TextRepr
Auto Trait Implementations§
impl Freeze for TextRepr
impl RefUnwindSafe for TextRepr
impl Send for TextRepr
impl Sync for TextRepr
impl Unpin for TextRepr
impl UnwindSafe for TextRepr
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