Enet4 / dicom-rs

Rust implementation of the DICOM standard
https://dicom-rs.github.io
Apache License 2.0
414 stars 82 forks source link

ClientAssociation release() and abort() take &mut self instead of mut self #308

Closed jmlaka closed 1 year ago

jmlaka commented 1 year ago

Hello, I stumbled upon this while incorporating ClientAssociation into some higher-level API. Can we change this? Makes working with the ClientAssociation easier.

Enet4 commented 1 year ago

Makes working with the ClientAssociation easier.

Could you share some details about your use case? This API was designed to consume the association because the connection should be dropped afterwards (AFAIK any further interactions would be non-standard). If we are to change these methods to only make the release exchange or send the abort message without dropping the connection, one would also need to advise consumers not to continue sending or receiving messages.

jmlaka commented 1 year ago

I got your point. I was trying to store the ClientAssociation inside a "FindSCU" struct. On second thought this is not necessary as the association needs not to live longer than a FindScu - send - receive cycle.