content frames

This commit is contained in:
nora 2022-02-10 02:50:53 +01:00
parent 970fdbb9b5
commit 4cf7d7558b
7 changed files with 101 additions and 10 deletions

View file

@ -6,5 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
bytes = "1.1.0"
parking_lot = "0.12.0"
smallvec = { version = "1.8.0", features = ["union"] }
uuid = "0.8.2"

View file

@ -1,5 +1,6 @@
#![warn(rust_2018_idioms)]
mod message;
pub mod methods;
use parking_lot::Mutex;

23
amqp_core/src/message.rs Normal file
View file

@ -0,0 +1,23 @@
#![allow(dead_code)]
use crate::methods;
use bytes::Bytes;
use smallvec::SmallVec;
use std::sync::Arc;
use uuid::Uuid;
pub type Message = Arc<RawMessage>;
pub struct RawMessage {
id: Uuid,
properties: methods::Table,
routing: RoutingInformation,
content: SmallVec<[Bytes; 1]>,
}
pub struct RoutingInformation {
pub exchange: String,
pub routing_key: String,
pub mandatory: bool,
pub immediate: bool,
}