mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-16 20:55:03 +01:00
start with write
This commit is contained in:
parent
83778ac2c9
commit
cb3710cd3f
6 changed files with 1337 additions and 699 deletions
47
amqp_transport/src/classes/write_helper.rs
Normal file
47
amqp_transport/src/classes/write_helper.rs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
use crate::classes::generated::{
|
||||
Bit, Long, Longlong, Longstr, Octet, Short, Shortstr, Table, Timestamp,
|
||||
};
|
||||
use crate::error::TransError;
|
||||
use std::io;
|
||||
use std::io::Write;
|
||||
|
||||
fn error(e: io::Error) -> TransError {
|
||||
TransError::Other(e.into())
|
||||
}
|
||||
|
||||
pub fn octet<W: Write>(value: Octet, writer: &mut W) -> Result<(), TransError> {
|
||||
writer.write_all(&[value])?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn short<W: Write>(value: Short, writer: &mut W) -> Result<(), TransError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn long<W: Write>(value: Long, writer: &mut W) -> Result<(), TransError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn longlong<W: Write>(value: Longlong, writer: &mut W) -> Result<(), TransError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn bit<W: Write>(value: Vec<Bit>, writer: &mut W) -> Result<(), TransError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn shortstr<W: Write>(value: Shortstr, writer: &mut W) -> Result<(), TransError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn longstr<W: Write>(value: Longstr, writer: &mut W) -> Result<(), TransError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn timestamp<W: Write>(value: Timestamp, writer: &mut W) -> Result<(), TransError> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn table<W: Write>(value: Table, writer: &mut W) -> Result<(), TransError> {
|
||||
todo!()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue