pub struct ServerAssociationOptions<'a, A> { /* private fields */ }
Expand description

A DICOM association builder for an acceptor DICOM node, often taking the role of a service class provider (SCP).

This is the standard way of negotiating and establishing an association with a requesting node. The outcome is a ServerAssociation. Unlike the ClientAssociationOptions, a value of this type can be reused for multiple connections.

§Example

let scp_options = ServerAssociationOptions::new()
   .with_abstract_syntax("1.2.840.10008.1.1")
   .with_transfer_syntax("1.2.840.10008.1.2.1");

let (stream, _address) = tcp_listener.accept()?;
scp_options.establish(stream)?;

The SCP will by default accept all transfer syntaxes supported by the main transfer syntax registry, unless one or more transfer syntaxes are explicitly indicated through calls to with_transfer_syntax.

Access control logic is also available, enabling application entities to decide on whether to accept or reject the association request based on the called and calling AE titles.

Implementations§

source§

impl<'a> ServerAssociationOptions<'a, AcceptAny>

source

pub fn new() -> Self

Create a new set of options for establishing an association.

source§

impl<'a, A> ServerAssociationOptions<'a, A>
where A: AccessControl,

source

pub fn accept_any(self) -> ServerAssociationOptions<'a, AcceptAny>

Change the access control policy to accept any association regardless of the specified AE titles.

This is the default behavior when the options are first created.

source

pub fn accept_called_ae_title( self ) -> ServerAssociationOptions<'a, AcceptCalledAeTitle>

Change the access control policy to accept an association if the called AE title matches this node’s AE title.

The default is to accept any requesting node regardless of the specified AE titles.

source

pub fn ae_access_control<P>( self, access_control: P ) -> ServerAssociationOptions<'a, P>
where P: AccessControl,

Change the access control policy.

The default is to accept any requesting node regardless of the specified AE titles.

source

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

Define the application entity title referring to this DICOM node.

The default is THIS-SCP.

source

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

Include this abstract syntax in the list of proposed presentation contexts.

source

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

Include this transfer syntax in each proposed presentation context.

source

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

Override the maximum expected PDU length.

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 promiscuous(self, promiscuous: bool) -> Self

Override promiscuous mode: whether to accept unknown abstract syntaxes.

source

pub fn establish(&self, socket: TcpStream) -> Result<ServerAssociation>

Negotiate an association with the given TCP stream.

Trait Implementations§

source§

impl<'a, A: Clone> Clone for ServerAssociationOptions<'a, A>

source§

fn clone(&self) -> ServerAssociationOptions<'a, 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, A: Debug> Debug for ServerAssociationOptions<'a, A>

source§

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

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

impl<'a> Default for ServerAssociationOptions<'a, AcceptAny>

source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<'a, A> Freeze for ServerAssociationOptions<'a, A>
where A: Freeze,

§

impl<'a, A> RefUnwindSafe for ServerAssociationOptions<'a, A>
where A: RefUnwindSafe,

§

impl<'a, A> Send for ServerAssociationOptions<'a, A>
where A: Send,

§

impl<'a, A> Sync for ServerAssociationOptions<'a, A>
where A: Sync,

§

impl<'a, A> Unpin for ServerAssociationOptions<'a, A>
where A: Unpin,

§

impl<'a, A> UnwindSafe for ServerAssociationOptions<'a, A>
where A: UnwindSafe,

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> 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,

§

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>,

§

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>,

§

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