pub struct ClientAssociation<S> { /* private fields */ }Expand description
A DICOM upper level association from the perspective of a requesting application entity.
The most common operations of an established association are
send
and receive.
Sending large P-Data fragments may be easier through the P-Data sender
abstraction (see send_pdata).
Call release at the end
to perform a standard C-RELEASE message exchange
and shut down the underlying TCP connection.
Not calling this method will only close the socket
without gracefully releasing the association.
Implementations§
Source§impl<S> ClientAssociation<S>
impl<S> ClientAssociation<S>
Sourcepub fn read_timeout(&self) -> Option<Duration>
pub fn read_timeout(&self) -> Option<Duration>
Retrieve read timeout for the association
Sourcepub fn write_timeout(&self) -> Option<Duration>
pub fn write_timeout(&self) -> Option<Duration>
Retrieve write timeout for the association
Sourcepub fn acceptor_max_pdu_length(&self) -> u32
pub fn acceptor_max_pdu_length(&self) -> u32
Retrieve the maximum PDU length that the association acceptor is expecting to receive.
Sourcepub fn requestor_max_pdu_length(&self) -> u32
pub fn requestor_max_pdu_length(&self) -> u32
Retrieve the maximum PDU length that the association requestor is expecting to receive.
Sourcepub fn user_variables(&self) -> &[UserVariableItem]
pub fn user_variables(&self) -> &[UserVariableItem]
Retrieve the user variables that were taken from the server.
It usually contains the maximum PDU length, the implementation class UID, and the implementation version name.
Sourcepub fn presentation_contexts(&self) -> &[PresentationContextNegotiated]
pub fn presentation_contexts(&self) -> &[PresentationContextNegotiated]
Retrieve the list of negotiated presentation contexts.
Source§impl<S> ClientAssociation<S>
impl<S> ClientAssociation<S>
Sourcepub fn send(&mut self, pdu: &Pdu) -> Result<(), Error>
pub fn send(&mut self, pdu: &Pdu) -> Result<(), Error>
Send a PDU message to the other intervenient.
Sourcepub fn receive(&mut self) -> Result<Pdu, Error>
pub fn receive(&mut self) -> Result<Pdu, Error>
Read a PDU message from the other intervenient.
Sourcepub fn send_pdata(&mut self, presentation_context_id: u8) -> PDataWriter<&mut S> ⓘ
pub fn send_pdata(&mut self, presentation_context_id: u8) -> PDataWriter<&mut S> ⓘ
Prepare a P-Data writer for sending one or more data item PDUs.
Returns a writer which automatically splits the inner data into separate PDUs if necessary.
Sourcepub fn release(self) -> Result<(), Error>
pub fn release(self) -> Result<(), Error>
Iniate a graceful release of the association.
A DIMSE A-RELEASE transaction is initiated by this application entity, and the underlying socket is closed once settled.
Note that as of version 0.9.1,
ClientAssociation no longer calls this method on Drop,
so remember to call release explicitly
at the end of all DIMSE transactions.
Sourcepub fn abort(self) -> Result<(), Error>
pub fn abort(self) -> Result<(), Error>
Send a provider initiated abort message and shut down the TCP connection, terminating the association.
Sourcepub fn receive_pdata(&mut self) -> PDataReader<'_, &mut S> ⓘ
pub fn receive_pdata(&mut self) -> PDataReader<'_, &mut S> ⓘ
Prepare a P-Data reader for receiving one or more data item PDUs.
Returns a reader which automatically receives more data PDUs once the bytes collected are consumed.
Sourcepub fn inner_stream(&mut self) -> &mut S
pub fn inner_stream(&mut self) -> &mut S
Obtain access to the inner stream connected to the association acceptor.
This can be used to send the PDU in semantic fragments of the message, thus using less memory.
Note: reading and writing should be done with care
to avoid inconsistencies in the association state.
Do not call send and receive while not in a PDU boundary.
Trait Implementations§
Source§impl Release for ClientAssociation<TcpStream>
impl Release for ClientAssociation<TcpStream>
Source§impl<S> Association for ClientAssociation<S>
impl<S> Association for ClientAssociation<S>
Source§fn acceptor_max_pdu_length(&self) -> u32
fn acceptor_max_pdu_length(&self) -> u32
Retrieve the maximum PDU length that the association acceptor is expecting to receive.
Source§fn requestor_max_pdu_length(&self) -> u32
fn requestor_max_pdu_length(&self) -> u32
Retrieve the maximum PDU length that the association requestor is expecting to receive.
Source§fn local_max_pdu_length(&self) -> u32
fn local_max_pdu_length(&self) -> u32
Retrieve the maximum PDU length that this application entity (the association requestor) is expecting to receive.
Source§fn peer_max_pdu_length(&self) -> u32
fn peer_max_pdu_length(&self) -> u32
Retrieve the maximum PDU length that the peer application entity (the association acceptor) is expecting to receive.
Source§fn peer_ae_title(&self) -> &str
fn peer_ae_title(&self) -> &str
Source§fn presentation_contexts(&self) -> &[PresentationContextNegotiated]
fn presentation_contexts(&self) -> &[PresentationContextNegotiated]
Source§fn user_variables(&self) -> &[UserVariableItem]
fn user_variables(&self) -> &[UserVariableItem]
Source§impl<S: Debug> Debug for ClientAssociation<S>
impl<S: Debug> Debug for ClientAssociation<S>
Source§impl<S> SyncAssociation<S> for ClientAssociation<S>
impl<S> SyncAssociation<S> for ClientAssociation<S>
Source§fn inner_stream(&mut self) -> &mut S
fn inner_stream(&mut self) -> &mut S
Source§fn get_mut(&mut self) -> (&mut S, &mut BytesMut)
fn get_mut(&mut self) -> (&mut S, &mut BytesMut)
Source§fn send(&mut self, pdu: &Pdu) -> Result<(), Error>
fn send(&mut self, pdu: &Pdu) -> Result<(), Error>
Source§fn abort(self) -> Result<(), Error>where
Self: Sized,
fn abort(self) -> Result<(), Error>where
Self: Sized,
Source§fn release(self) -> Result<(), Error>where
Self: Sized,
fn release(self) -> Result<(), Error>where
Self: Sized,
Source§fn send_pdata(&mut self, presentation_context_id: u8) -> PDataWriter<&mut S> ⓘ
fn send_pdata(&mut self, presentation_context_id: u8) -> PDataWriter<&mut S> ⓘ
Source§fn receive_pdata(&mut self) -> PDataReader<'_, &mut S> ⓘ
fn receive_pdata(&mut self) -> PDataReader<'_, &mut S> ⓘ
Auto Trait Implementations§
impl<S> Freeze for ClientAssociation<S>where
S: Freeze,
impl<S> RefUnwindSafe for ClientAssociation<S>where
S: RefUnwindSafe,
impl<S> Send for ClientAssociation<S>where
S: Send,
impl<S> Sync for ClientAssociation<S>where
S: Sync,
impl<S> Unpin for ClientAssociation<S>where
S: Unpin,
impl<S> UnsafeUnpin for ClientAssociation<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for ClientAssociation<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more