forall W, C.
exposed struct ReadingWriter! {
out: W,
cx: C,
}
A writer that also carries a context that reads a domain's bytes (ReadBytes), so an f-string can interpolate text of that domain directly: every {text} is read through the writer's own context, one context serving any number of parts. finish hands both back. `f"...".write(&cx, out)is written through one, the context moved out ofcx` and put back:
let text = f"{name} = {value}".write(&cx, Buffer!::new());
Methods
method newsource
fn new(out: W, cx: C) -> ReadingWriter![W, C] { ... }
A writer to out that reads text through cx.
method finishsource
fn finish(self) -> (W, C) { ... }
Ends the session, handing back the inner writer and the context.
Instances
instance Writer[ReadingWriter![W, C]]source
forall W, C where Writer[W].
instance Writer[ReadingWriter![W, C]] { ... }
In core::fmt.
Every write goes to the inner writer.
instance Format[Str['r], ReadingWriter![W, C]]source
forall W, C, 'r where Writer[W], ReadBytes[C, Str['r]].
instance Format[Str['r], ReadingWriter![W, C]] { ... }
In core::fmt.
Text formats as its bytes, read through the writer's context: f"{name}".write(&cx, out) with name: Str['k]. A Str['static] in an f-string is written directly, as literal text is.