File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,9 @@ impl OutputPayload {
5252impl Service {
5353 pub ( crate ) fn apply_options ( & mut self , options : ServiceOptions ) {
5454 // Apply service options
55+ if let Some ( name) = options. name {
56+ self . name = ServiceName :: try_from ( name) . expect ( "Service name valid" ) ;
57+ }
5558 self . metadata . extend ( options. metadata ) ;
5659 self . inactivity_timeout = options. inactivity_timeout . map ( |d| d. as_millis ( ) as u64 ) ;
5760 self . abort_timeout = options. abort_timeout . map ( |d| d. as_millis ( ) as u64 ) ;
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ use std::time::Duration;
99/// Various configuration options that can be provided when binding a service
1010#[ derive( Default , Debug , Clone ) ]
1111pub struct ServiceOptions {
12+ /// When set, overrides the service name (defaults to trait name or `#[name]` attribute)
13+ pub ( crate ) name : Option < String > ,
1214 pub ( crate ) metadata : HashMap < String , String > ,
1315 pub ( crate ) inactivity_timeout : Option < Duration > ,
1416 pub ( crate ) abort_timeout : Option < Duration > ,
You can’t perform that action at this time.
0 commit comments