pub struct ClientAssociation { /* 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
).
When the value falls out of scope, the program will automatically try to gracefully release the association through a standard C-RELEASE message exchange, then shut down the underlying TCP connection.
Implementations§
Source§impl ClientAssociation
impl ClientAssociation
Sourcepub fn presentation_contexts(&self) -> &[PresentationContextResult]
pub fn presentation_contexts(&self) -> &[PresentationContextResult]
Retrieve the list of negotiated presentation contexts.
Sourcepub fn acceptor_max_pdu_length(&self) -> u32
pub fn acceptor_max_pdu_length(&self) -> u32
Retrieve the maximum PDU length admitted by the association acceptor.
Sourcepub fn requestor_max_pdu_length(&self) -> u32
pub fn requestor_max_pdu_length(&self) -> u32
Retrieve the maximum PDU length that this application entity is expecting to receive.
The current implementation is not required to fail and/or abort the association if a larger PDU is received.
Sourcepub fn release(self) -> Result<()>
pub fn release(self) -> Result<()>
Gracefully terminate the association by exchanging release messages and then shutting down the TCP connection.
Sourcepub fn abort(self) -> Result<()>
pub fn abort(self) -> Result<()>
Send an abort message and shut down the TCP connection, terminating the association.
Sourcepub fn inner_stream(&mut self) -> &mut TcpStream
pub fn inner_stream(&mut self) -> &mut TcpStream
Obtain access to the inner TCP 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.
Sourcepub fn send_pdata(
&mut self,
presentation_context_id: u8,
) -> PDataWriter<&mut TcpStream> ⓘ
pub fn send_pdata( &mut self, presentation_context_id: u8, ) -> PDataWriter<&mut TcpStream> ⓘ
Prepare a P-Data writer for sending one or more data items.
Returns a writer which automatically splits the inner data into separate PDUs if necessary.
Sourcepub fn receive_pdata(&mut self) -> PDataReader<&mut TcpStream> ⓘ
pub fn receive_pdata(&mut self) -> PDataReader<&mut TcpStream> ⓘ
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.
Trait Implementations§
Source§impl Debug for ClientAssociation
impl Debug for ClientAssociation
Auto Trait Implementations§
impl Freeze for ClientAssociation
impl RefUnwindSafe for ClientAssociation
impl Send for ClientAssociation
impl Sync for ClientAssociation
impl Unpin for ClientAssociation
impl UnwindSafe for ClientAssociation
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