@@ -426,7 +426,7 @@ impl ImageProxy {
426
426
} ;
427
427
428
428
// Verify semantic version
429
- let protover = r. impl_request :: < String , _ , ( ) > ( "Initialize" , [ ] ) . await ?. 0 ;
429
+ let protover = r. impl_request :: < String > ( "Initialize" , [ ( ) ; 0 ] ) . await ?. 0 ;
430
430
tracing:: debug!( "Remote protocol version: {protover}" ) ;
431
431
let protover = semver:: Version :: parse ( protover. as_str ( ) ) ?;
432
432
// Previously we had a feature to opt-in to requiring newer versions using `if cfg!()`.
@@ -493,15 +493,11 @@ impl ImageProxy {
493
493
}
494
494
495
495
#[ instrument( skip( args) ) ]
496
- async fn impl_request < R : serde:: de:: DeserializeOwned + Send + ' static , T , I > (
496
+ async fn impl_request < R : serde:: de:: DeserializeOwned + Send + ' static > (
497
497
& self ,
498
498
method : & str ,
499
- args : T ,
500
- ) -> Result < ( R , Option < FileDescriptors > ) >
501
- where
502
- T : IntoIterator < Item = I > ,
503
- I : Into < serde_json:: Value > ,
504
- {
499
+ args : impl IntoIterator < Item = impl Into < serde_json:: Value > > ,
500
+ ) -> Result < ( R , Option < FileDescriptors > ) > {
505
501
let req = Self :: impl_request_raw ( Arc :: clone ( & self . sockfd ) , Request :: new ( method, args) ) ;
506
502
let mut childwait = self . childwait . lock ( ) . await ;
507
503
tokio:: select! {
@@ -528,7 +524,7 @@ impl ImageProxy {
528
524
pub async fn open_image ( & self , imgref : & str ) -> Result < OpenedImage > {
529
525
tracing:: debug!( "opening image" ) ;
530
526
let ( imgid, _) = self
531
- . impl_request :: < u32 , _ , _ > ( "OpenImage" , [ imgref] )
527
+ . impl_request :: < u32 > ( "OpenImage" , [ imgref] )
532
528
. await ?;
533
529
Ok ( OpenedImage ( imgid) )
534
530
}
@@ -537,7 +533,7 @@ impl ImageProxy {
537
533
pub async fn open_image_optional ( & self , imgref : & str ) -> Result < Option < OpenedImage > > {
538
534
tracing:: debug!( "opening image" ) ;
539
535
let ( imgid, _) = self
540
- . impl_request :: < u32 , _ , _ > ( "OpenImageOptional" , [ imgref] )
536
+ . impl_request :: < u32 > ( "OpenImageOptional" , [ imgref] )
541
537
. await ?;
542
538
if imgid == 0 {
543
539
Ok ( None )
@@ -591,7 +587,7 @@ impl ImageProxy {
591
587
/// For more information on OCI config, see <https://github.com/opencontainers/image-spec/blob/main/config.md>
592
588
pub async fn fetch_config_raw ( & self , img : & OpenedImage ) -> Result < Vec < u8 > > {
593
589
let ( _, fd) = self
594
- . impl_request :: < ( ) , _ , _ > ( "GetFullConfig" , [ img. 0 ] )
590
+ . impl_request :: < ( ) > ( "GetFullConfig" , [ img. 0 ] )
595
591
. await ?;
596
592
self . read_all_fd ( fd) . await
597
593
}
@@ -630,7 +626,7 @@ impl ImageProxy {
630
626
tracing:: debug!( "fetching blob" ) ;
631
627
let args: Vec < serde_json:: Value > =
632
628
vec ! [ img. 0 . into( ) , digest. to_string( ) . into( ) , size. into( ) ] ;
633
- let ( _bloblen, fd) = self . impl_request :: < i64 , _ , _ > ( "GetBlob" , args) . await ?;
629
+ let ( _bloblen, fd) = self . impl_request :: < i64 > ( "GetBlob" , args) . await ?;
634
630
let fd = fd. ok_or_else ( || Error :: Other ( "Missing fd from reply" . into ( ) ) ) ?;
635
631
let FileDescriptors :: FinishPipe { pipeid, datafd } = fd else {
636
632
return Err ( Error :: Other ( "got dualfds, expecting FinishPipe fd" . into ( ) ) ) ;
@@ -682,7 +678,7 @@ impl ImageProxy {
682
678
) > {
683
679
tracing:: debug!( "fetching blob" ) ;
684
680
let args: Vec < serde_json:: Value > = vec ! [ img. 0 . into( ) , digest. to_string( ) . into( ) ] ;
685
- let ( bloblen, fd) = self . impl_request :: < u64 , _ , _ > ( "GetRawBlob" , args) . await ?;
681
+ let ( bloblen, fd) = self . impl_request :: < u64 > ( "GetRawBlob" , args) . await ?;
686
682
let fd = fd. ok_or_else ( || Error :: new_other ( "Missing fd from reply" ) ) ?;
687
683
let FileDescriptors :: DualFds { datafd, errfd } = fd else {
688
684
return Err ( Error :: Other ( "got single fd, expecting dual fds" . into ( ) ) ) ;
@@ -715,7 +711,7 @@ impl ImageProxy {
715
711
tracing:: debug!( "Getting layer info" ) ;
716
712
if layer_info_piped_proto_version ( ) . matches ( & self . protover ) {
717
713
let ( _, fd) = self
718
- . impl_request :: < ( ) , _ , _ > ( "GetLayerInfoPiped" , [ img. 0 ] )
714
+ . impl_request :: < ( ) > ( "GetLayerInfoPiped" , [ img. 0 ] )
719
715
. await ?;
720
716
let buf = self . read_all_fd ( fd) . await ?;
721
717
return Ok ( Some ( serde_json:: from_slice ( & buf) ?) ) ;
0 commit comments