diff --git a/ul/src/association/client.rs b/ul/src/association/client.rs index b966521b..b32de904 100644 --- a/ul/src/association/client.rs +++ b/ul/src/association/client.rs @@ -103,13 +103,6 @@ pub enum Error { /// no presentation contexts accepted by the server NoAcceptedPresentationContexts { backtrace: Backtrace }, - /// failed to write PDU message - #[non_exhaustive] - Send { - #[snafu(backtrace)] - source: crate::pdu::writer::Error, - }, - /// failed to send PDU message on wire #[non_exhaustive] WireSend { diff --git a/ul/src/pdu/reader.rs b/ul/src/pdu/reader.rs index 5024dc0e..aa2b1641 100644 --- a/ul/src/pdu/reader.rs +++ b/ul/src/pdu/reader.rs @@ -10,26 +10,27 @@ pub type Error = crate::pdu::ReadError; pub type Result = std::result::Result; /// The default maximum PDU size -#[deprecated(since = "0.7.2", note = "Use dicom_ul::pdu::DEFAULT_MAX_PDU instead")] +#[deprecated(since = "0.8.0", note = "Use dicom_ul::pdu::DEFAULT_MAX_PDU instead")] pub const DEFAULT_MAX_PDU: u32 = crate::pdu::DEFAULT_MAX_PDU; /// The minimum PDU size, /// as specified by the standard -#[deprecated(since = "0.7.2", note = "Use dicom_ul::pdu::MINIMUM_PDU_SIZE instead")] +#[deprecated(since = "0.8.0", note = "Use dicom_ul::pdu::MINIMUM_PDU_SIZE instead")] pub const MINIMUM_PDU_SIZE: u32 = crate::pdu::MINIMUM_PDU_SIZE; /// The maximum PDU size, /// as specified by the standard -#[deprecated(since = "0.7.2", note = "Use dicom_ul::pdu::MAXIMUM_PDU_SIZE instead")] +#[deprecated(since = "0.8.0", note = "Use dicom_ul::pdu::MAXIMUM_PDU_SIZE instead")] pub const MAXIMUM_PDU_SIZE: u32 = crate::pdu::MAXIMUM_PDU_SIZE; /// The length of the PDU header in bytes, /// comprising the PDU type (1 byte), /// reserved byte (1 byte), /// and PDU length (4 bytes). -#[deprecated(since = "0.7.2", note = "Use dicom_ul::pdu::PDU_HEADER_SIZE instead")] +#[deprecated(since = "0.8.0", note = "Use dicom_ul::pdu::PDU_HEADER_SIZE instead")] pub const PDU_HEADER_SIZE: u32 = crate::pdu::PDU_HEADER_SIZE; +/// Read a PDU from the given byte buffer. pub fn read_pdu(mut buf: impl Buf, max_pdu_length: u32, strict: bool) -> Result> { ensure!( (super::MINIMUM_PDU_SIZE..=super::MAXIMUM_PDU_SIZE).contains(&max_pdu_length),