Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/der/src/writer.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / der / src / writer.rs` 29 lines ยท 620 bytes Raw Blame History 1 //! Writer trait. 2 3 #[cfg(feature = "pem")] 4 pub(crate) mod pem; 5 pub(crate) mod slice; 6 7 use crate::Result; 8 9 #[cfg(feature = "std")] 10 use std::io; 11 12 /// Writer trait which outputs encoded DER. 13 pub trait Writer { 14 /// Write the given DER-encoded bytes as output. 15 fn write(&mut self, slice: &[u8]) -> Result<()>; 16 17 /// Write a single byte. 18 fn write_byte(&mut self, byte: u8) -> Result<()> { 19 self.write(&[byte]) 20 } 21 } 22 23 #[cfg(feature = "std")] 24 impl Writer for W { 25 fn write(&mut self, slice: &[u8]) -> Result<()> { 26 ::write(self, slice)?; 27 Ok(()) 28 } 29 }