Remove unused
This commit is contained in:
@@ -9,17 +9,14 @@ serde = { version = "1.0", features = ["derive"] }
|
||||
serde_json = "1.0"
|
||||
tracing = "0.1.37"
|
||||
async-channel = "2.3.1"
|
||||
bytes = "1.8"
|
||||
bytes = "1.10"
|
||||
byteorder = "1.5"
|
||||
futures-util = { version = "0.3.31", features = ["io"] }
|
||||
chrono = "0.4"
|
||||
humantime = "2.1.0"
|
||||
humantime-serde = "1.1.1"
|
||||
slidebuf = "0.0.1"
|
||||
thiserror = "=0.0.1"
|
||||
autoerr = "0.0.3"
|
||||
series = { path = "../daqbuf-series", package = "daqbuf-series" }
|
||||
netpod = { path = "../daqbuf-netpod", package = "daqbuf-netpod" }
|
||||
mettrics = { version = "0.0.6", path = "../mettrics" }
|
||||
|
||||
[patch.crates-io]
|
||||
thiserror = { git = "https://github.com/dominikwerder/thiserror.git", branch = "cstm" }
|
||||
|
||||
137
src/ca/proto.rs
137
src/ca/proto.rs
@@ -13,35 +13,35 @@ use std::task::Context;
|
||||
use std::task::Poll;
|
||||
use std::time::Instant;
|
||||
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
#[cstm(name = "CaProto")]
|
||||
pub enum Error {
|
||||
SlideBuf(#[from] slidebuf::Error),
|
||||
#[error("BufferTooSmallForNeedMin({0}, {1})")]
|
||||
BufferTooSmallForNeedMin(usize, usize),
|
||||
IO(#[from] io::Error),
|
||||
BadSlice,
|
||||
BadCaDbrTypeId(u16),
|
||||
BadCaScalarTypeId(u16),
|
||||
GetValHelpInnerTypeMismatch,
|
||||
GetValHelpTodoWaveform,
|
||||
NotEnoughPayload,
|
||||
TodoConversionArray,
|
||||
CaProtoVersionMissing,
|
||||
NotEnoughPayloadTimeMetadata(usize),
|
||||
MismatchDbrTimeType,
|
||||
BadCaCount,
|
||||
CaCommandNotSupported(u16),
|
||||
ParseAttemptInDoneState,
|
||||
UnexpectedHeader,
|
||||
ExtendedHeaderBadCount,
|
||||
NoReadBufferSpace,
|
||||
NeitherPendingNorProgress,
|
||||
OutputBufferTooSmall,
|
||||
LogicError,
|
||||
BadPayload,
|
||||
CaImageUnsupported,
|
||||
}
|
||||
autoerr::create_error_v1!(
|
||||
name(Error, "CaProto"),
|
||||
enum variants {
|
||||
SlideBuf(#[from] slidebuf::Error),
|
||||
BufferTooSmallForNeedMin(usize, usize),
|
||||
IO(#[from] io::Error),
|
||||
BadSlice,
|
||||
BadCaDbrTypeId(u16),
|
||||
BadCaScalarTypeId(u16),
|
||||
GetValHelpInnerTypeMismatch,
|
||||
GetValHelpTodoWaveform,
|
||||
NotEnoughPayload,
|
||||
TodoConversionArray,
|
||||
CaProtoVersionMissing,
|
||||
NotEnoughPayloadTimeMetadata(usize),
|
||||
MismatchDbrTimeType,
|
||||
BadCaCount,
|
||||
CaCommandNotSupported(u16),
|
||||
ParseAttemptInDoneState,
|
||||
UnexpectedHeader,
|
||||
ExtendedHeaderBadCount,
|
||||
NoReadBufferSpace,
|
||||
NeitherPendingNorProgress,
|
||||
OutputBufferTooSmall,
|
||||
LogicError,
|
||||
BadPayload,
|
||||
CaImageUnsupported,
|
||||
},
|
||||
);
|
||||
|
||||
const CA_PROTO_VERSION: u32 = 13;
|
||||
const EPICS_EPOCH_OFFSET: u64 = 631152000;
|
||||
@@ -54,85 +54,6 @@ const TESTING_EVENT_ADD_RES_MAX: u32 = 3;
|
||||
const TESTING_PROTOCOL_ERROR_TODO_REMOVE: bool = false;
|
||||
const TESTING_PROTOCOL_ERROR_AFTER_BYTES: u32 = 400;
|
||||
|
||||
pub trait StatsCounter {
|
||||
fn inc(&mut self);
|
||||
}
|
||||
|
||||
pub trait StatsCumulative {
|
||||
fn add(&mut self, v: u64);
|
||||
}
|
||||
|
||||
pub trait StatsHisto {
|
||||
fn ingest(&mut self, v: u32);
|
||||
}
|
||||
|
||||
impl StatsCounter for () {
|
||||
fn inc(&mut self) {}
|
||||
}
|
||||
|
||||
impl StatsCumulative for () {
|
||||
fn add(&mut self, _v: u64) {}
|
||||
}
|
||||
|
||||
impl StatsHisto for () {
|
||||
fn ingest(&mut self, _v: u32) {}
|
||||
}
|
||||
|
||||
pub trait CaProtoStatsRecv: Unpin {
|
||||
fn out_msg_placed(&mut self) -> &mut dyn StatsCounter;
|
||||
fn out_bytes(&mut self) -> &mut dyn StatsCumulative;
|
||||
fn outbuf_len(&mut self) -> &mut dyn StatsHisto;
|
||||
fn tcp_recv_count(&mut self) -> &mut dyn StatsCounter;
|
||||
fn tcp_recv_bytes(&mut self) -> &mut dyn StatsCumulative;
|
||||
fn payload_ext_very_large(&mut self) -> &mut dyn StatsCounter;
|
||||
fn payload_ext_but_small(&mut self) -> &mut dyn StatsCounter;
|
||||
fn payload_size(&mut self) -> &mut dyn StatsHisto;
|
||||
fn protocol_issue(&mut self) -> &mut dyn StatsCounter;
|
||||
fn data_count(&mut self) -> &mut dyn StatsHisto;
|
||||
}
|
||||
|
||||
impl CaProtoStatsRecv for () {
|
||||
fn out_msg_placed(&mut self) -> &mut dyn StatsCounter {
|
||||
self
|
||||
}
|
||||
|
||||
fn out_bytes(&mut self) -> &mut dyn StatsCumulative {
|
||||
self
|
||||
}
|
||||
|
||||
fn outbuf_len(&mut self) -> &mut dyn StatsHisto {
|
||||
self
|
||||
}
|
||||
|
||||
fn tcp_recv_count(&mut self) -> &mut dyn StatsCounter {
|
||||
self
|
||||
}
|
||||
|
||||
fn tcp_recv_bytes(&mut self) -> &mut dyn StatsCumulative {
|
||||
self
|
||||
}
|
||||
|
||||
fn payload_ext_very_large(&mut self) -> &mut dyn StatsCounter {
|
||||
self
|
||||
}
|
||||
|
||||
fn payload_ext_but_small(&mut self) -> &mut dyn StatsCounter {
|
||||
self
|
||||
}
|
||||
|
||||
fn payload_size(&mut self) -> &mut dyn StatsHisto {
|
||||
self
|
||||
}
|
||||
|
||||
fn protocol_issue(&mut self) -> &mut dyn StatsCounter {
|
||||
self
|
||||
}
|
||||
|
||||
fn data_count(&mut self) -> &mut dyn StatsHisto {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Search {
|
||||
pub id: u32,
|
||||
|
||||
Reference in New Issue
Block a user