Struct dicom_ul::association::server::ServerAssociationOptions
source · 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.
- By default, the application will accept requests from anyone
(
AcceptAny
) - To only accept requests with a matching called AE title,
add a call to
accept_called_ae_title
(AcceptCalledAeTitle
). - Any other policy can be implemented through the
AccessControl
trait.
Implementations§
source§impl<'a> ServerAssociationOptions<'a, AcceptAny>
impl<'a> ServerAssociationOptions<'a, AcceptAny>
source§impl<'a, A> ServerAssociationOptions<'a, A>where
A: AccessControl,
impl<'a, A> ServerAssociationOptions<'a, A>where
A: AccessControl,
sourcepub fn accept_any(self) -> ServerAssociationOptions<'a, AcceptAny>
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.
sourcepub fn accept_called_ae_title(
self
) -> ServerAssociationOptions<'a, AcceptCalledAeTitle>
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.
sourcepub fn ae_access_control<P>(
self,
access_control: P
) -> ServerAssociationOptions<'a, P>where
P: AccessControl,
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.
sourcepub fn ae_title<T>(self, ae_title: T) -> Self
pub fn ae_title<T>(self, ae_title: T) -> Self
Define the application entity title referring to this DICOM node.
The default is THIS-SCP
.
sourcepub fn with_abstract_syntax<T>(self, abstract_syntax_uid: T) -> Self
pub fn with_abstract_syntax<T>(self, abstract_syntax_uid: T) -> Self
Include this abstract syntax in the list of proposed presentation contexts.
sourcepub fn with_transfer_syntax<T>(self, transfer_syntax_uid: T) -> Self
pub fn with_transfer_syntax<T>(self, transfer_syntax_uid: T) -> Self
Include this transfer syntax in each proposed presentation context.
sourcepub fn max_pdu_length(self, value: u32) -> Self
pub fn max_pdu_length(self, value: u32) -> Self
Override the maximum expected PDU length.
sourcepub fn strict(self, strict: bool) -> Self
pub fn strict(self, strict: bool) -> Self
Override strict mode: whether receiving PDUs must not surpass the negotiated maximum PDU length.
sourcepub fn promiscuous(self, promiscuous: bool) -> Self
pub fn promiscuous(self, promiscuous: bool) -> Self
Override promiscuous mode: whether to accept unknown abstract syntaxes.
sourcepub fn establish(&self, socket: TcpStream) -> Result<ServerAssociation>
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>
impl<'a, A: Clone> Clone for ServerAssociationOptions<'a, A>
source§fn clone(&self) -> ServerAssociationOptions<'a, A>
fn clone(&self) -> ServerAssociationOptions<'a, A>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a, A: Debug> Debug for ServerAssociationOptions<'a, A>
impl<'a, A: Debug> Debug for ServerAssociationOptions<'a, A>
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> 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