MCPcopy Create free account
hub / github.com/daisy/MathCAT / TreeOrString

Interface TreeOrString

src/speech.rs:256–264  ·  view source on GitHub ↗

As the name says, TreeOrString is either a Tree (Element) or a String It is used to share code during pattern matching

Source from the content-addressed store, hash-verified

254/// As the name says, TreeOrString is either a Tree (Element) or a String
255/// It is used to share code during pattern matching
256pub trait TreeOrString<'c, 'm:'c, T> {
257 fn from_element(e: Element<'m>) -> Result<T>;
258 fn from_string(s: String, doc: Document<'m>) -> Result<T>;
259 fn replace_tts<'s:'c, 'r>(tts: &TTS, command: &TTSCommandRule, prefs: &PreferenceManager, rules_with_context: &'r mut SpeechRulesWithContext<'c, 's,'m>, mathml: Element<'c>) -> Result<T>;
260 fn replace<'s:'c, 'r>(ra: &ReplacementArray, rules_with_context: &'r mut SpeechRulesWithContext<'c, 's,'m>, mathml: Element<'c>) -> Result<T>;
261 fn replace_nodes<'s:'c, 'r>(rules: &'r mut SpeechRulesWithContext<'c, 's,'m>, nodes: Vec<Node<'c>>, mathml: Element<'c>) -> Result<T>;
262 fn highlight_braille(braille: T, highlight_style: String) -> T;
263 fn mark_nav_speech(speech: T) -> T;
264}
265
266impl<'c, 'm:'c> TreeOrString<'c, 'm, String> for String {
267 fn from_element(_e: Element<'m>) -> Result<String> {

Callers

nothing calls this directly

Implementers 1

speech.rssrc/speech.rs

Calls

no outgoing calls

Tested by

no test coverage detected