Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework API adaptation in dicom_ul #592

Merged
merged 2 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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