File tree 1 file changed +7
-2
lines changed
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<()>;
37
37
/// An `App` holds loaded configuration for a Spin application.
38
38
#[ derive( Debug , Clone ) ]
39
39
pub struct App {
40
- id : String ,
40
+ id : Arc < str > ,
41
41
locked : Arc < LockedApp > ,
42
42
}
43
43
44
44
impl App {
45
45
/// Returns a new app for the given runtime-specific identifier and locked
46
46
/// app.
47
- pub fn new ( id : impl Into < String > , locked : LockedApp ) -> Self {
47
+ pub fn new ( id : impl Into < Arc < str > > , locked : LockedApp ) -> Self {
48
48
Self {
49
49
id : id. into ( ) ,
50
50
locked : Arc :: new ( locked) ,
@@ -56,6 +56,11 @@ impl App {
56
56
& self . id
57
57
}
58
58
59
+ /// Returns a runtime-specific identifier for this app.
60
+ pub fn id_shared ( & self ) -> Arc < str > {
61
+ self . id . clone ( )
62
+ }
63
+
59
64
/// Deserializes typed metadata for this app.
60
65
///
61
66
/// 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