pub enum Package {
Review,
Develop,
Autopilot,
Custom(Arc<CustomPackage>),
}Expand description
A preconfigured safety profile.
Variants§
Review
Full supervision. Every command asks.
Develop
Auto-approves builds, tests, VCS. Asks for destructive ops.
Autopilot
Maximum AI autonomy. Only catastrophic ops blocked.
Custom(Arc<CustomPackage>)
User-defined custom package loaded from ~/.rippy/packages/<name>.toml.
Implementations§
Source§impl Package
impl Package
Sourcepub fn parse(s: &str) -> Result<Self, String>
pub fn parse(s: &str) -> Result<Self, String>
Parse a built-in package name from a string.
For custom packages use Package::resolve, which checks built-ins
first and then ~/.rippy/packages/<name>.toml.
§Errors
Returns an error if the name does not match a built-in package.
Sourcepub fn resolve(name: &str, home: Option<&Path>) -> Result<Self, RippyError>
pub fn resolve(name: &str, home: Option<&Path>) -> Result<Self, RippyError>
Resolve a package name to a built-in or custom package.
Built-in names (review, develop, autopilot) always take priority.
If a custom file in ~/.rippy/packages/ has the same name as a built-in,
a warning is printed to stderr and the built-in is used.
Pass None for home to skip custom package resolution.
§Errors
Returns RippyError::Config if a custom package file exists but is
malformed. Returns RippyError::Setup if the name is unknown.
Sourcepub const fn all() -> &'static [Self]
pub const fn all() -> &'static [Self]
All built-in packages in display order (most restrictive first).
Sourcepub const fn all_builtin() -> [Self; 3]
pub const fn all_builtin() -> [Self; 3]
All built-in packages as an owned array.
Sourcepub fn all_available(home: Option<&Path>) -> Vec<Self>
pub fn all_available(home: Option<&Path>) -> Vec<Self>
All packages available: built-ins followed by discovered custom packages.
Pass None for home to return only built-ins.
Sourcepub const fn is_custom(&self) -> bool
pub const fn is_custom(&self) -> bool
Whether this package is user-defined (loaded from ~/.rippy/packages/).
Sourcepub fn toml_source(&self) -> &str
pub fn toml_source(&self) -> &str
Raw TOML source for the package’s rules.
Trait Implementations§
impl Eq for Package
impl StructuralPartialEq for Package
Auto Trait Implementations§
impl Freeze for Package
impl RefUnwindSafe for Package
impl Send for Package
impl Sync for Package
impl Unpin for Package
impl UnsafeUnpin for Package
impl UnwindSafe for Package
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.