1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! Installing language profiles into a profile registry and publishing claims.
use ;
use crate::;
/// Summary returned by [`install_profile_stub`]: the installed profile symbol
/// and its organ and conformance-test counts.
/// Operation key for the standard install operation.
/// Install `profile` into `registry` and publish its claims, gated on
/// [`standard_install_capability`].
///
/// This is a first-reach entry point: it registers the profile, publishes its
/// profile and badge claims, and returns a [`StandardInstallReport`].
///
/// [`standard_install_capability`]: crate::standard_install_capability
///
/// # Examples
///
/// ```
/// use std::sync::Arc;
///
/// use sim_kernel::{Cx, DefaultFactory, NoopEvalPolicy, Symbol};
/// use sim_lib_standard_core::{
/// LanguageProfile, ProfileRegistry, install_profile_stub, standard_install_capability,
/// };
///
/// let mut cx = Cx::new(Arc::new(NoopEvalPolicy), Arc::new(DefaultFactory));
/// cx.grant(standard_install_capability());
/// let mut registry = ProfileRegistry::new();
///
/// let profile = LanguageProfile::new(Symbol::qualified("lang", "demo/v1"))
/// .with_reader(Symbol::qualified("codec", "lisp"));
/// let report = install_profile_stub(&mut cx, &mut registry, profile).unwrap();
///
/// assert_eq!(report.profile, Symbol::qualified("lang", "demo/v1"));
/// assert!(registry.profile(&Symbol::qualified("lang", "demo/v1")).is_some());
/// ```