File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -37,14 +37,14 @@ pub type ValidatorFn = dyn Fn(&App, &[&str]) -> anyhow::Result<()>;
3737/// An `App` holds loaded configuration for a Spin application.
3838#[ derive( Debug , Clone ) ]
3939pub struct App {
40- id : String ,
40+ id : Arc < str > ,
4141 locked : Arc < LockedApp > ,
4242}
4343
4444impl App {
4545 /// Returns a new app for the given runtime-specific identifier and locked
4646 /// app.
47- pub fn new ( id : impl Into < String > , locked : LockedApp ) -> Self {
47+ pub fn new ( id : impl Into < Arc < str > > , locked : LockedApp ) -> Self {
4848 Self {
4949 id : id. into ( ) ,
5050 locked : Arc :: new ( locked) ,
@@ -56,6 +56,11 @@ impl App {
5656 & self . id
5757 }
5858
59+ /// Returns a runtime-specific identifier for this app.
60+ pub fn id_shared ( & self ) -> Arc < str > {
61+ self . id . clone ( )
62+ }
63+
5964 /// Deserializes typed metadata for this app.
6065 ///
6166 /// Returns `Ok(None)` if there is no metadata for the given `key` and an
You can’t perform that action at this time.
0 commit comments