Struct ClientAssociationOptions

Source
pub struct ClientAssociationOptions<'a> { /* private fields */ }
Expand description

A DICOM association builder for a client node. The final outcome is a ClientAssociation.

This is the standard way of requesting and establishing an association with another DICOM node, that one usually taking the role of a service class provider (SCP).

§Example

let association = ClientAssociationOptions::new()
   .with_presentation_context("1.2.840.10008.1.1", vec!["1.2.840.10008.1.2.1", "1.2.840.10008.1.2"])
   .establish("129.168.0.5:104")?;

At least one presentation context must be specified, using the method with_presentation_context and supplying both an abstract syntax and list of transfer syntaxes.

A helper method with_abstract_syntax will include by default the transfer syntaxes Implicit VR Little Endian and Explicit VR Little Endian in the resulting presentation context.

§Example

let association = ClientAssociationOptions::new()
    .with_abstract_syntax("1.2.840.10008.1.1")
    .establish("129.168.0.5:104")?;

Implementations§

Source§

impl<'a> ClientAssociationOptions<'a>

Source

pub fn new() -> Self

Create a new set of options for establishing an association.

Source

pub fn calling_ae_title<T>(self, calling_ae_title: T) -> Self
where T: Into<Cow<'a, str>>,

Define the calling application entity title for the association, which refers to this DICOM node.

The default is THIS-SCU.

Source

pub fn called_ae_title<T>(self, called_ae_title: T) -> Self
where T: Into<Cow<'a, str>>,

Define the called application entity title for the association, which refers to the target DICOM node.

The default is ANY-SCP. Passing an emoty string resets the AE title to the default (or to the one passed via establish_with).

Source

pub fn with_presentation_context<T>( self, abstract_syntax_uid: T, transfer_syntax_uids: Vec<T>, ) -> Self
where T: Into<Cow<'a, str>>,

Include this presentation context in the list of proposed presentation contexts.

Source

pub fn with_abstract_syntax<T>(self, abstract_syntax_uid: T) -> Self
where T: Into<Cow<'a, str>>,

Helper to add this abstract syntax with the default transfer syntaxes to the list of proposed presentation contexts.

Source

pub fn max_pdu_length(self, value: u32) -> Self

Override the maximum PDU length that this application entity will admit.

Source

pub fn strict(self, strict: bool) -> Self

Override strict mode: whether receiving PDUs must not surpass the negotiated maximum PDU length.

Source

pub fn username<T>(self, username: T) -> Self
where T: Into<Cow<'a, str>>,

Sets the user identity username

Source

pub fn password<T>(self, password: T) -> Self
where T: Into<Cow<'a, str>>,

Sets the user identity password

Source

pub fn username_password<T, U>(self, username: T, password: U) -> Self
where T: Into<Cow<'a, str>>, U: Into<Cow<'a, str>>,

Sets the user identity username and password

Source

pub fn kerberos_service_ticket<T>(self, kerberos_service_ticket: T) -> Self
where T: Into<Cow<'a, str>>,

Sets the user identity Kerberos service ticket

Source

pub fn saml_assertion<T>(self, saml_assertion: T) -> Self
where T: Into<Cow<'a, str>>,

Sets the user identity SAML assertion

Source

pub fn jwt<T>(self, jwt: T) -> Self
where T: Into<Cow<'a, str>>,

Sets the user identity JWT

Source

pub fn establish<A: ToSocketAddrs>( self, address: A, ) -> Result<ClientAssociation>

Initiate the TCP connection to the given address and request a new DICOM association, negotiating the presentation contexts in the process.

Source

pub fn establish_with(self, ae_address: &str) -> Result<ClientAssociation>

Initiate the TCP connection to the given address and request a new DICOM association, negotiating the presentation contexts in the process.

This method allows you to specify the called AE title alongside with the socket address. See AeAddr for more details. However, the AE title in this parameter is overridden by any called_ae_title option previously received.

§Example
let association = ClientAssociationOptions::new()
    .with_abstract_syntax("1.2.840.10008.1.1")
    // called AE title in address
    .establish_with("MY-STORAGE@10.0.0.100:104")?;
Source

pub fn read_timeout(self, timeout: Duration) -> Self

Set the read timeout for the underlying TCP socket

Source

pub fn write_timeout(self, timeout: Duration) -> Self

Set the write timeout for the underlying TCP socket

Trait Implementations§

Source§

impl<'a> Clone for ClientAssociationOptions<'a>

Source§

fn clone(&self) -> ClientAssociationOptions<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for ClientAssociationOptions<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for ClientAssociationOptions<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more