Trait osshkeys::sshbuf::SshWriteExt [−][src]
pub trait SshWriteExt {
fn write_bool(&mut self, value: bool) -> Result<()>;
fn write_uint8(&mut self, value: u8) -> Result<()>;
fn write_uint32(&mut self, value: u32) -> Result<()>;
fn write_uint64(&mut self, value: u64) -> Result<()>;
fn write_string(&mut self, buf: &[u8]) -> Result<()>;
fn write_utf8(&mut self, value: &str) -> Result<()>;
fn write_mpint(&mut self, value: &BigNumRef) -> Result<()>;
}
Expand description
io::Write extension to read ssh data
Required methods
fn write_bool(&mut self, value: bool) -> Result<()>
fn write_bool(&mut self, value: bool) -> Result<()>
Convert boolean to one byte and write it
By definition, false should be 0 and true should be 1. Any other value is not allowed.
fn write_uint8(&mut self, value: u8) -> Result<()>
fn write_uint8(&mut self, value: u8) -> Result<()>
Write a byte into the stream
fn write_uint32(&mut self, value: u32) -> Result<()>
fn write_uint32(&mut self, value: u32) -> Result<()>
Write 32 bits unsigned integer in big endian
fn write_uint64(&mut self, value: u64) -> Result<()>
fn write_uint64(&mut self, value: u64) -> Result<()>
Write 64 bits unsigned integer in big endian
Write binary string data
Before the binary string, there is a 32 bits unsigned integer to indicate the length of the data, and the binary string is NOT null-terminating.
fn write_utf8(&mut self, value: &str) -> Result<()>
fn write_utf8(&mut self, value: &str) -> Result<()>
Write UTF-8 string
Convert the string into bytes array and write it using write_string().
fn write_mpint(&mut self, value: &BigNumRef) -> Result<()>
fn write_mpint(&mut self, value: &BigNumRef) -> Result<()>
Write multiple precision integer
Convert the integer into bytes array and write it.