Skip to content

Commit

Permalink
Merge pull request #592 from Enet4/chore/ul/rework-adapt-api
Browse files Browse the repository at this point in the history
Rework API adaptation in `dicom_ul`
  • Loading branch information
Enet4 authored Nov 2, 2024
2 parents 9688a97 + d1ca894 commit f2fefa7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 0 additions & 7 deletions ul/src/association/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
9 changes: 5 additions & 4 deletions ul/src/pdu/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,27 @@ pub type Error = crate::pdu::ReadError;
pub type Result<T> = std::result::Result<T, Error>;

/// 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<Option<Pdu>> {
ensure!(
(super::MINIMUM_PDU_SIZE..=super::MAXIMUM_PDU_SIZE).contains(&max_pdu_length),
Expand Down

0 comments on commit f2fefa7

Please sign in to comment.