[INFO] crate varlink_stdinterfaces 8.0.0 is already in cache [INFO] extracting crate varlink_stdinterfaces 8.0.0 into work/ex/pr-63376/sources/master#60960a260f7b5c695fd0717311d72ce62dd4eb43/reg/varlink_stdinterfaces/8.0.0 [INFO] extracting crate varlink_stdinterfaces 8.0.0 into work/ex/pr-63376/sources/try#266783e4e09e4e9d5307c1c8e695659c58bbcac7/reg/varlink_stdinterfaces/8.0.0 [INFO] validating manifest of varlink_stdinterfaces-8.0.0 on toolchain master#60960a260f7b5c695fd0717311d72ce62dd4eb43 [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+60960a260f7b5c695fd0717311d72ce62dd4eb43-alt" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] validating manifest of varlink_stdinterfaces-8.0.0 on toolchain try#266783e4e09e4e9d5307c1c8e695659c58bbcac7 [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+266783e4e09e4e9d5307c1c8e695659c58bbcac7-alt" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] started frobbing varlink_stdinterfaces-8.0.0 [INFO] finished frobbing varlink_stdinterfaces-8.0.0 [INFO] frobbed toml for varlink_stdinterfaces-8.0.0 written to work/ex/pr-63376/sources/master#60960a260f7b5c695fd0717311d72ce62dd4eb43/reg/varlink_stdinterfaces/8.0.0/Cargo.toml [INFO] started frobbing varlink_stdinterfaces-8.0.0 [INFO] finished frobbing varlink_stdinterfaces-8.0.0 [INFO] frobbed toml for varlink_stdinterfaces-8.0.0 written to work/ex/pr-63376/sources/try#266783e4e09e4e9d5307c1c8e695659c58bbcac7/reg/varlink_stdinterfaces/8.0.0/Cargo.toml [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+60960a260f7b5c695fd0717311d72ce62dd4eb43-alt" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+266783e4e09e4e9d5307c1c8e695659c58bbcac7-alt" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+60960a260f7b5c695fd0717311d72ce62dd4eb43-alt" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+266783e4e09e4e9d5307c1c8e695659c58bbcac7-alt" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] checking varlink_stdinterfaces-8.0.0 against try#266783e4e09e4e9d5307c1c8e695659c58bbcac7 for pr-63376 [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/pr-63376/worker-6/try#266783e4e09e4e9d5307c1c8e695659c58bbcac7:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/pr-63376/sources/try#266783e4e09e4e9d5307c1c8e695659c58bbcac7/reg/varlink_stdinterfaces/8.0.0:/opt/crater/workdir:ro,Z" "-v" "/mnt/big/crater/work/local/cargo-home:/opt/crater/cargo-home:ro,Z" "-v" "/mnt/big/crater/work/local/rustup-home:/opt/crater/rustup-home:ro,Z" "-e" "USER_ID=1000" "-e" "SOURCE_DIR=/opt/crater/workdir" "-e" "MAP_USER_ID=1000" "-e" "CARGO_TARGET_DIR=/opt/crater/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/crater/cargo-home" "-e" "RUSTUP_HOME=/opt/crater/rustup-home" "-w" "/opt/crater/workdir" "-m" "1536M" "--network" "none" "rustops/crates-build-env" "/opt/crater/cargo-home/bin/cargo" "+266783e4e09e4e9d5307c1c8e695659c58bbcac7-alt" "check" "--frozen" "--all" "--all-targets"` [INFO] [stdout] 0e9b88288d2aac9beff75143f6d4ac5cc300ed59802fef4ae89bd88c6f2d4cad [INFO] running `"docker" "start" "-a" "0e9b88288d2aac9beff75143f6d4ac5cc300ed59802fef4ae89bd88c6f2d4cad"` [INFO] [stderr] Compiling varlink_parser v4.0.2 [INFO] [stderr] Compiling chainerror v0.4.3 [INFO] [stderr] Checking varlink v8.1.0 [INFO] [stderr] Compiling varlink_generator v8.0.0 [INFO] [stderr] Compiling varlink_stdinterfaces v8.0.0 (/opt/crater/workdir) [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:2567 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^ help: use `dyn`: `dyn StdError` [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(bare_trait_objects)]` on by default [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:5302 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInfo` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:5385 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_Resolve` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:5533 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^ help: use `dyn`: `dyn BufRead` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:6800 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn VarlinkInterface + Send + Sync` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:6890 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn VarlinkInterface + Send + Sync` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:7742 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^ help: use `dyn`: `dyn BufRead` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:8070 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInfo` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:8510 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_Resolve` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:263:35 [INFO] [stderr] | [INFO] [stderr] 263 | fn get_info(&self, call: &mut Call_GetInfo) -> varlink::Result<()>; [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInfo` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:266:20 [INFO] [stderr] | [INFO] [stderr] 266 | call: &mut Call_GetInterfaceDescription, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInterfaceDescription` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:272:26 [INFO] [stderr] | [INFO] [stderr] 272 | _bufreader: &mut BufRead, [INFO] [stderr] | ^^^^^^^ help: use `dyn`: `dyn BufRead` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:317:16 [INFO] [stderr] | [INFO] [stderr] 317 | inner: Box, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn VarlinkInterface + Send + Sync` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:321:23 [INFO] [stderr] | [INFO] [stderr] 321 | pub fn new(inner: Box) -> VarlinkInterfaceProxy { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn VarlinkInterface + Send + Sync` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:335:25 [INFO] [stderr] | [INFO] [stderr] 335 | bufreader: &mut BufRead, [INFO] [stderr] | ^^^^^^^ help: use `dyn`: `dyn BufRead` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:342:79 [INFO] [stderr] | [INFO] [stderr] 342 | "org.varlink.service.GetInfo" => self.inner.get_info(call as &mut Call_GetInfo), [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInfo` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:354:38 [INFO] [stderr] | [INFO] [stderr] 354 | call as &mut Call_GetInterfaceDescription, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInterfaceDescription` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:2567 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^ help: use `dyn`: `dyn StdError` [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(bare_trait_objects)]` on by default [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:5302 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInfo` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:5385 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_Resolve` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:5533 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^ help: use `dyn`: `dyn BufRead` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:6800 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn VarlinkInterface + Send + Sync` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:6890 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn VarlinkInterface + Send + Sync` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:7742 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^ help: use `dyn`: `dyn BufRead` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:8070 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInfo` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> /opt/crater/target/debug/build/varlink_stdinterfaces-3c9723e1cc98f44b/out/org.varlink.resolver.rs:1:8510 [INFO] [stderr] | [INFO] [stderr] 1 | use serde_derive :: { { Deserialize , Serialize } } ; use serde_json ; use std :: io :: BufRead ; use std :: sync :: { { Arc , RwLock } } ; use varlink :: { { self , CallTrait } } ; # [ allow ( dead_code ) ] # [ derive ( Clone , PartialEq , Debug ) ] pub enum ErrorKind { Varlink_Error , VarlinkReply_Error , InterfaceNotFound ( Option < InterfaceNotFound_Args > ) } impl :: std :: fmt :: Display for ErrorKind { fn fmt ( & self , f : & mut :: std :: fmt :: Formatter ) -> :: std :: fmt :: Result { match self { ErrorKind :: Varlink_Error => write ! ( f , "Varlink Error" ) , ErrorKind :: VarlinkReply_Error => write ! ( f , "Varlink error reply" ) , ErrorKind :: InterfaceNotFound ( v ) => write ! ( f , "org.varlink.resolver.InterfaceNotFound: {:#?}" , v ) } } } pub struct Error ( pub ErrorKind , pub Option < Box < dyn std :: error :: Error + 'static >> , pub Option < & 'static str > , ) ; impl Error { # [ allow ( dead_code ) ] pub fn kind ( & self ) -> & ErrorKind { & self . 0 } } impl From < ErrorKind > for Error { fn from ( e : ErrorKind ) -> Self { Error ( e , None , None ) } } impl std :: error :: Error for Error { fn source ( & self ) -> Option < & ( dyn std :: error :: Error + 'static ) > { self . 1 . as_ref ( ) . map ( | e | e . as_ref ( ) ) } } impl std :: fmt :: Display for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { std :: fmt :: Display :: fmt ( & self . 0 , f ) } } impl std :: fmt :: Debug for Error { fn fmt ( & self , f : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { use std :: error :: Error as StdError ; if let Some ( ref o ) = self . 2 { std :: fmt :: Display :: fmt ( o , f ) ? ; } std :: fmt :: Debug :: fmt ( & self . 0 , f ) ? ; if let Some ( e ) = self . source ( ) { std :: fmt :: Display :: fmt ( "\nCaused by:\n" , f ) ? ; std :: fmt :: Debug :: fmt ( & e , f ) ? ; } Ok ( ( ) ) } } # [ allow ( dead_code ) ] pub type Result < T > = std :: result :: Result < T , Error > ; impl From < varlink :: Error > for Error { fn from ( e : varlink :: Error , ) -> Self { match e . kind ( ) { varlink :: ErrorKind :: VarlinkErrorReply ( r ) => Error ( ErrorKind :: from ( r ) , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) , _ => Error ( ErrorKind :: Varlink_Error , Some ( Box :: from ( e ) ) , Some ( concat ! ( file ! ( ) , ":" , line ! ( ) , ": " ) ) ) } } } # [ allow ( dead_code ) ] impl Error { pub fn source_varlink_kind ( & self ) -> Option < & varlink :: ErrorKind > { use std :: error :: Error as StdError ; let mut s : & StdError = self ; while let Some ( c ) = s . source ( ) { let k = self . source ( ) . and_then ( | e | e . downcast_ref :: < varlink :: Error > ( ) ) . and_then ( | e | Some ( e . kind ( ) ) ) ; if k . is_some ( ) { return k ; } s = c ; } None } } impl From < & varlink :: Reply > for ErrorKind { # [ allow ( unused_variables ) ] fn from ( e : & varlink :: Reply ) -> Self { match e { varlink :: Reply { error : Some ( ref t ) , .. } if t == "org.varlink.resolver.InterfaceNotFound" => { match e { varlink :: Reply { parameters : Some ( p ) , .. } => match serde_json :: from_value ( p . clone ( ) ) { Ok ( v ) => ErrorKind :: InterfaceNotFound ( v ) , Err ( _ ) => ErrorKind :: InterfaceNotFound ( None ) , } , _ => ErrorKind :: InterfaceNotFound ( None ) , } } _ => ErrorKind :: VarlinkReply_Error , } } } pub trait VarlinkCallError : varlink :: CallTrait { fn reply_interface_not_found ( & mut self , r#interface : String ) -> varlink :: Result < ( ) > { self . reply_struct ( varlink :: Reply :: error ( "org.varlink.resolver.InterfaceNotFound" , Some ( serde_json :: to_value ( InterfaceNotFound_Args { r#interface } ) . map_err ( varlink :: map_context ! ( ) ) ? ) ) ) } } impl < 'a > VarlinkCallError for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct InterfaceNotFound_Args { pub r#interface : String , } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Reply { pub r#vendor : String , pub r#product : String , pub r#version : String , pub r#url : String , pub r#interfaces : Vec < String > , } impl varlink :: VarlinkReply for GetInfo_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct GetInfo_Args { } pub trait Call_GetInfo : VarlinkCallError { fn reply ( & mut self , r#vendor : String , r#product : String , r#version : String , r#url : String , r#interfaces : Vec < String > ) -> varlink :: Result < ( ) > { self . reply_struct ( GetInfo_Reply { r#vendor , r#product , r#version , r#url , r#interfaces } . into ( ) ) } } impl < 'a > Call_GetInfo for varlink :: Call < 'a > { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Reply { pub r#address : String , } impl varlink :: VarlinkReply for Resolve_Reply { } # [ derive ( Serialize , Deserialize , Debug , PartialEq , Clone ) ] pub struct Resolve_Args { pub r#interface : String , } pub trait Call_Resolve : VarlinkCallError { fn reply ( & mut self , r#address : String ) -> varlink :: Result < ( ) > { self . reply_struct ( Resolve_Reply { r#address } . into ( ) ) } } impl < 'a > Call_Resolve for varlink :: Call < 'a > { } pub trait VarlinkInterface { fn get_info ( & self , call : & mut Call_GetInfo , ) -> varlink :: Result < ( ) > ; fn resolve ( & self , call : & mut Call_Resolve , r#interface : String ) -> varlink :: Result < ( ) > ; fn call_upgraded ( & self , _call : & mut varlink :: Call , _bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { Ok ( Vec :: new ( ) ) } } pub trait VarlinkClientInterface { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > ; fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > ; } # [ allow ( dead_code ) ] pub struct VarlinkClient { connection : Arc < RwLock < varlink :: Connection >> , } impl VarlinkClient { # [ allow ( dead_code ) ] pub fn new ( connection : Arc < RwLock < varlink :: Connection >> ) -> Self { VarlinkClient { connection , } } } impl VarlinkClientInterface for VarlinkClient { fn get_info ( & mut self , ) -> varlink :: MethodCall < GetInfo_Args , GetInfo_Reply , Error > { varlink :: MethodCall :: < GetInfo_Args , GetInfo_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.GetInfo" , GetInfo_Args { } ) } fn resolve ( & mut self , r#interface : String ) -> varlink :: MethodCall < Resolve_Args , Resolve_Reply , Error > { varlink :: MethodCall :: < Resolve_Args , Resolve_Reply , Error > :: new ( self . connection . clone ( ) , "org.varlink.resolver.Resolve" , Resolve_Args { r#interface } ) } } # [ allow ( dead_code ) ] pub struct VarlinkInterfaceProxy { inner : Box < VarlinkInterface + Send + Sync > , } # [ allow ( dead_code ) ] pub fn new ( inner : Box < VarlinkInterface + Send + Sync > ) -> VarlinkInterfaceProxy { VarlinkInterfaceProxy { inner } } impl varlink :: Interface for VarlinkInterfaceProxy { fn get_description ( & self ) -> & 'static str { "# Interface to resolve reverse-domain interface names to\n# service adresses\ninterface org.varlink.resolver\n\n# Get a list of all resolvable interfaces and information\n# about the resolver's identity.\nmethod GetInfo() -> (\n vendor: string,\n product: string,\n version: string,\n url: string,\n interfaces: []string\n)\n\n# Resolve an interface name to a registered varlink service address\nmethod Resolve(interface: string) -> (address: string)\n\nerror InterfaceNotFound (interface: string)\n" } fn get_name ( & self ) -> & 'static str { "org.varlink.resolver" } fn call_upgraded ( & self , call : & mut varlink :: Call , bufreader : & mut BufRead ) -> varlink :: Result < Vec < u8 >> { self . inner . call_upgraded ( call , bufreader ) } fn call ( & self , call : & mut varlink :: Call ) -> varlink :: Result < ( ) > { let req = call . request . unwrap ( ) ; match req . method . as_ref ( ) { "org.varlink.resolver.GetInfo" => self . inner . get_info ( call as & mut Call_GetInfo ) , "org.varlink.resolver.Resolve" => { if let Some ( args ) = req . parameters . clone ( ) { let args : Resolve_Args = match serde_json :: from_value ( args ) { Ok ( v ) => v , Err ( e ) => { let es = format ! ( "{}" , e ) ; let _ = call . reply_invalid_parameter ( es . clone ( ) ) ; return Err ( varlink :: context ! ( varlink :: ErrorKind :: SerdeJsonDe ( es ) ) . into ( ) ) ; } } ; self . inner . resolve ( call as & mut Call_Resolve , args . r#interface ) } else { call . reply_invalid_parameter ( "parameters" . into ( ) ) } } , m => { call . reply_method_not_found ( String :: from ( m ) ) } } } } [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_Resolve` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:263:35 [INFO] [stderr] | [INFO] [stderr] 263 | fn get_info(&self, call: &mut Call_GetInfo) -> varlink::Result<()>; [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInfo` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:266:20 [INFO] [stderr] | [INFO] [stderr] 266 | call: &mut Call_GetInterfaceDescription, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInterfaceDescription` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:272:26 [INFO] [stderr] | [INFO] [stderr] 272 | _bufreader: &mut BufRead, [INFO] [stderr] | ^^^^^^^ help: use `dyn`: `dyn BufRead` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:317:16 [INFO] [stderr] | [INFO] [stderr] 317 | inner: Box, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn VarlinkInterface + Send + Sync` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:321:23 [INFO] [stderr] | [INFO] [stderr] 321 | pub fn new(inner: Box) -> VarlinkInterfaceProxy { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn VarlinkInterface + Send + Sync` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:335:25 [INFO] [stderr] | [INFO] [stderr] 335 | bufreader: &mut BufRead, [INFO] [stderr] | ^^^^^^^ help: use `dyn`: `dyn BufRead` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:342:79 [INFO] [stderr] | [INFO] [stderr] 342 | "org.varlink.service.GetInfo" => self.inner.get_info(call as &mut Call_GetInfo), [INFO] [stderr] | ^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInfo` [INFO] [stderr] [INFO] [stderr] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stderr] --> src/org_varlink_service.rs:354:38 [INFO] [stderr] | [INFO] [stderr] 354 | call as &mut Call_GetInterfaceDescription, [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn Call_GetInterfaceDescription` [INFO] [stderr] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 14.82s [INFO] running `"docker" "inspect" "0e9b88288d2aac9beff75143f6d4ac5cc300ed59802fef4ae89bd88c6f2d4cad"` [INFO] running `"docker" "rm" "-f" "0e9b88288d2aac9beff75143f6d4ac5cc300ed59802fef4ae89bd88c6f2d4cad"` [INFO] [stdout] 0e9b88288d2aac9beff75143f6d4ac5cc300ed59802fef4ae89bd88c6f2d4cad