@@ -327,26 +327,34 @@ pub type QpuConnectionOptions = ExecutionOptions;
327
327
/// Builder for setting up [`QpuConnectionOptions`].
328
328
pub type QpuConnectionOptionsBuilder = ExecutionOptionsBuilder ;
329
329
330
- /// Options avaialable when executing a job on a QPU.
330
+ /// Options available when executing a job on a QPU.
331
331
///
332
332
/// Use [`Default`] to get a reasonable set of defaults, or start with [`ExecutionOptionsBuilder`]
333
333
/// to build a custom set of options.
334
- #[ derive( Builder , Clone , Debug , Default , PartialEq ) ]
334
+ #[ derive( Builder , Clone , Debug , PartialEq ) ]
335
335
pub struct ExecutionOptions {
336
336
#[ doc = "The [`ConnectionStrategy`] to use to establish a connection to the QPU." ]
337
337
#[ builder( default ) ]
338
338
connection_strategy : ConnectionStrategy ,
339
339
#[ doc = "The timeout to use for the request, defaults to 30 seconds. If set to `None`, then there is no timeout." ]
340
340
#[ builder( default = "Some(Duration::from_secs(30))" ) ]
341
341
timeout : Option < Duration > ,
342
- #[ doc = "Options avaialable when executing a job on a QPU, particular to the execution service's API." ]
342
+ #[ doc = "Options available when executing a job on a QPU, particular to the execution service's API." ]
343
343
#[ builder( default = "None" ) ]
344
344
api_options : Option < InnerApiExecutionOptions > ,
345
345
}
346
346
347
+ impl Default for ExecutionOptions {
348
+ fn default ( ) -> Self {
349
+ ExecutionOptionsBuilder :: default ( ) . build ( ) . expect (
350
+ "Should be able to derive a default set of the ExecutionOptions from the builder." ,
351
+ )
352
+ }
353
+ }
354
+
347
355
impl Eq for ExecutionOptions { }
348
356
349
- /// Options avaialable when executing a job on a QPU, particular to the execution service's API.
357
+ /// Options available when executing a job on a QPU, particular to the execution service's API.
350
358
/// This is a conventent alias for [`InnerApiExecutionOptions`] which provides a builder.
351
359
///
352
360
/// Use [`Default`] to get a reasonable set of defaults, or start with [`ApiExecutionOptionsBuilder`]
@@ -702,3 +710,18 @@ pub enum QpuApiError {
702
710
message : String ,
703
711
} ,
704
712
}
713
+
714
+ #[ cfg( test) ]
715
+ mod test {
716
+ use crate :: qpu:: api:: ExecutionOptions ;
717
+
718
+ use super :: ExecutionOptionsBuilder ;
719
+
720
+ #[ test]
721
+ fn test_default_execution_options ( ) {
722
+ assert_eq ! (
723
+ ExecutionOptions :: default ( ) ,
724
+ ExecutionOptionsBuilder :: default ( ) . build( ) . unwrap( ) ,
725
+ ) ;
726
+ }
727
+ }
0 commit comments