@@ -116,16 +116,16 @@ impl BasicClient {
116
116
///#
117
117
///# fn main() -> Result<(), Box<dyn Error>> {
118
118
///use parsec_client::BasicClient;
119
- ///let client = BasicClient::new_naked();
119
+ ///let client = BasicClient::new_naked()? ;
120
120
///let (major, minor) = client.ping()?;
121
121
///# Ok(())}
122
122
/// ```
123
- pub fn new_naked ( ) -> Self {
124
- BasicClient {
125
- op_client : Default :: default ( ) ,
123
+ pub fn new_naked ( ) -> Result < Self > {
124
+ Ok ( BasicClient {
125
+ op_client : OperationClient :: new ( ) ? ,
126
126
auth_data : Authentication :: None ,
127
127
implicit_provider : ProviderId :: Core ,
128
- }
128
+ } )
129
129
}
130
130
131
131
/// Query the service for the list of authenticators provided and use the first one as default
@@ -150,7 +150,7 @@ impl BasicClient {
150
150
///# fn main() -> Result<(), Box<dyn Error>> {
151
151
///use parsec_client::BasicClient;
152
152
///use parsec_client::core::interface::requests::ProviderId;
153
- ///let mut client = BasicClient::new_naked();
153
+ ///let mut client = BasicClient::new_naked()? ;
154
154
///// Set the default authenticator but choose a specific provider.
155
155
///client.set_implicit_provider(ProviderId::Pkcs11);
156
156
///client.set_default_auth(Some("main_client".to_string()))?;
@@ -209,7 +209,7 @@ impl BasicClient {
209
209
///# fn main() -> Result<(), Box<dyn Error>> {
210
210
///use parsec_client::BasicClient;
211
211
///use parsec_client::auth::Authentication;
212
- ///let mut client = BasicClient::new_naked();
212
+ ///let mut client = BasicClient::new_naked()? ;
213
213
///client.set_auth_data(Authentication::UnixPeerCredentials);
214
214
///assert_eq!(Authentication::UnixPeerCredentials, client.auth_data());
215
215
///# Ok(())}
@@ -233,7 +233,7 @@ impl BasicClient {
233
233
///# fn main() -> Result<(), Box<dyn Error>> {
234
234
///use parsec_client::BasicClient;
235
235
///use parsec_client::auth::Authentication;
236
- ///let mut client = BasicClient::new_naked();
236
+ ///let mut client = BasicClient::new_naked()? ;
237
237
///// Use the default provider but use a specific authentication.
238
238
///client.set_default_provider()?;
239
239
///client.set_auth_data(Authentication::UnixPeerCredentials);
@@ -268,7 +268,7 @@ impl BasicClient {
268
268
///# fn main() -> Result<(), Box<dyn Error>> {
269
269
///use parsec_client::BasicClient;
270
270
///use parsec_client::core::interface::requests::ProviderId;
271
- ///let mut client = BasicClient::new_naked();
271
+ ///let mut client = BasicClient::new_naked()? ;
272
272
///client.set_implicit_provider(ProviderId::Pkcs11);
273
273
///assert_eq!(ProviderId::Pkcs11, client.implicit_provider());
274
274
///# Ok(())}
@@ -327,7 +327,7 @@ impl BasicClient {
327
327
///# fn main() -> Result<(), Box<dyn Error>> {
328
328
///use parsec_client::BasicClient;
329
329
///
330
- ///let mut client: BasicClient = BasicClient::new_naked();
330
+ ///let mut client: BasicClient = BasicClient::new_naked()? ;
331
331
///let providers = client.list_providers()?;
332
332
///// Set the second most prioritary provider
333
333
///client.set_implicit_provider(providers[1].id);
@@ -1291,3 +1291,13 @@ impl BasicClient {
1291
1291
}
1292
1292
}
1293
1293
}
1294
+
1295
+ impl Default for BasicClient {
1296
+ fn default ( ) -> Self {
1297
+ BasicClient {
1298
+ op_client : Default :: default ( ) ,
1299
+ auth_data : Authentication :: None ,
1300
+ implicit_provider : ProviderId :: Core ,
1301
+ }
1302
+ }
1303
+ }
0 commit comments