File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,9 +178,7 @@ macro_rules! declare_plugin {
178178 $caps
179179 }
180180
181- extern "C" fn initialize(
182- config: $crate:: PluginConfig ,
183- ) -> $crate:: FfiResult <( ) > {
181+ extern "C" fn initialize( config: $crate:: PluginConfig ) -> $crate:: FfiResult <( ) > {
184182 let init_fn: fn ( $crate:: PluginConfig ) -> $crate:: FfiResult <( ) > = $init;
185183 init_fn( config)
186184 }
Original file line number Diff line number Diff line change @@ -22,8 +22,7 @@ pub trait QidoPlugin: Send + Sync {
2222 ///
2323 /// # Returns
2424 /// A stream of DICOM objects matching the search criteria, or an error.
25- fn search ( & self , request : FfiSearchRequest )
26- -> FfiFuture < FfiResult < FfiDicomObjectStreamBox > > ;
25+ fn search ( & self , request : FfiSearchRequest ) -> FfiFuture < FfiResult < FfiDicomObjectStreamBox > > ;
2726
2827 /// Check if the plugin is healthy and ready to serve requests.
2928 ///
Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ pub trait WadoPlugin: Send + Sync {
2626 ///
2727 /// # Returns
2828 /// A stream of DICOM files, or an error.
29- fn retrieve ( & self , request : FfiRetrieveRequest )
30- -> FfiFuture < FfiResult < FfiDicomFileStreamBox > > ;
29+ fn retrieve ( & self , request : FfiRetrieveRequest ) -> FfiFuture < FfiResult < FfiDicomFileStreamBox > > ;
3130
3231 /// Render a DICOM instance to an image.
3332 ///
@@ -50,8 +49,7 @@ pub trait WadoPlugin: Send + Sync {
5049 ///
5150 /// # Returns
5251 /// A stream of DICOM files (metadata will be extracted by host), or an error.
53- fn metadata ( & self , request : FfiMetadataRequest )
54- -> FfiFuture < FfiResult < FfiDicomFileStreamBox > > ;
52+ fn metadata ( & self , request : FfiMetadataRequest ) -> FfiFuture < FfiResult < FfiDicomFileStreamBox > > ;
5553
5654 /// Check if the plugin is healthy and ready to serve requests.
5755 #[ sabi( last_prefix_field) ]
Original file line number Diff line number Diff line change @@ -360,7 +360,9 @@ impl crate::api::stow::StowService for PluginStowAdapter {
360360 . filter_map ( |obj| {
361361 let mut buffer = Vec :: new ( ) ;
362362 match obj. write_all ( & mut buffer) {
363- Ok ( ( ) ) => Some ( dicom_rst_plugin_api:: FfiDicomFile { data : buffer. into ( ) } ) ,
363+ Ok ( ( ) ) => Some ( dicom_rst_plugin_api:: FfiDicomFile {
364+ data : buffer. into ( ) ,
365+ } ) ,
364366 Err ( e) => {
365367 error ! ( "Failed to serialize DICOM object for plugin: {e}" ) ;
366368 None
Original file line number Diff line number Diff line change @@ -58,12 +58,12 @@ impl PluginRegistry {
5858 } ) ?;
5959
6060 // Get the root module
61- let module = header
62- . init_root_module :: < PluginModuleRef > ( )
63- . map_err ( |e| PluginLoadError :: InitFailed {
61+ let module = header. init_root_module :: < PluginModuleRef > ( ) . map_err ( |e| {
62+ PluginLoadError :: InitFailed {
6463 path : path. display ( ) . to_string ( ) ,
6564 source : e,
66- } ) ?;
65+ }
66+ } ) ?;
6767
6868 // Get plugin info
6969 let id = ( module. plugin_id ( ) ) ( ) . to_string ( ) ;
@@ -84,25 +84,19 @@ impl PluginRegistry {
8484
8585 // Create service instances (wrapped in Arc for sharing)
8686 let qido = if capabilities. supports_qido {
87- ( module. create_qido_service ( ) ) ( )
88- . into_option ( )
89- . map ( Arc :: new)
87+ ( module. create_qido_service ( ) ) ( ) . into_option ( ) . map ( Arc :: new)
9088 } else {
9189 None
9290 } ;
9391
9492 let wado = if capabilities. supports_wado {
95- ( module. create_wado_service ( ) ) ( )
96- . into_option ( )
97- . map ( Arc :: new)
93+ ( module. create_wado_service ( ) ) ( ) . into_option ( ) . map ( Arc :: new)
9894 } else {
9995 None
10096 } ;
10197
10298 let stow = if capabilities. supports_stow {
103- ( module. create_stow_service ( ) ) ( )
104- . into_option ( )
105- . map ( Arc :: new)
99+ ( module. create_stow_service ( ) ) ( ) . into_option ( ) . map ( Arc :: new)
106100 } else {
107101 None
108102 } ;
Original file line number Diff line number Diff line change @@ -13,18 +13,18 @@ use crate::backend::plugin::PluginRegistry;
1313use crate :: config:: { AppConfig , HttpServerConfig } ;
1414use crate :: types:: AE ;
1515use association:: pool:: AssociationPools ;
16+ use axum:: extract:: { DefaultBodyLimit , Request } ;
17+ use axum:: response:: Response ;
18+ use std:: net:: SocketAddr ;
1619#[ cfg( feature = "plugins" ) ]
1720use std:: path:: PathBuf ;
1821#[ cfg( feature = "plugins" ) ]
1922use std:: sync:: Arc ;
20- #[ cfg( feature = "plugins" ) ]
21- use tokio:: sync:: RwLock ;
22- use axum:: extract:: { DefaultBodyLimit , Request } ;
23- use axum:: response:: Response ;
24- use std:: net:: SocketAddr ;
2523use std:: time:: Duration ;
2624use tokio:: net:: TcpListener ;
2725use tokio:: signal;
26+ #[ cfg( feature = "plugins" ) ]
27+ use tokio:: sync:: RwLock ;
2828use tower_http:: cors:: CorsLayer ;
2929use tower_http:: timeout:: TimeoutLayer ;
3030use tower_http:: trace;
You can’t perform that action at this time.
0 commit comments