Add string-consuming writer to admin context interface.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2026-01-15 22:05:11 +00:00
parent 8be0a579db
commit febd4d1a23

View File

@@ -23,14 +23,12 @@ impl Context<'_> {
arguments: fmt::Arguments<'_>,
) -> impl Future<Output = Result> + Send + '_ + use<'_> {
let buf = format!("{arguments}");
self.output.lock().then(async move |mut output| {
output
.write_all(buf.as_bytes())
.map_err(Into::into)
.await
})
self.write_string(buf)
}
#[inline]
pub(crate) async fn write_string(&self, s: String) -> Result { self.write_str(&s).await }
pub(crate) fn write_str<'a>(
&'a self,
s: &'a str,