Skip to main content

Routine

Struct Routine 

Source
pub struct Routine {
Show 14 fields pub id: String, pub name: String, pub instructions: String, pub enabled: bool, pub when: Vec<Trigger>, pub project: Option<String>, pub model: Option<String>, pub allowed: Approvals, pub grants: Vec<String>, pub tell: Tell, pub channels: Vec<String>, pub missed: Missed, pub keep: u32, pub created_at: i64,
}
Expand description

A saved routine.

Fields§

§id: String

[a-z0-9-], made by the engine for new routines.

§name: String§instructions: String

What a run is asked to do (the prompt).

§enabled: bool§when: Vec<Trigger>

What starts it besides Run now.

§project: Option<String>

The project (workspace id) its runs work in; None: a folder of its own.

§model: Option<String>

The model profile its runs use; None: the default model.

§allowed: Approvals

What its runs may do without asking (default Read only).

§grants: Vec<String>

Tools its runs may call without asking beyond allowed (“Always for this routine”).

§tell: Tell

When a run tells the user.

§channels: Vec<String>

Where reports go (desktop, or a plugin’s plugin:channel).

§missed: Missed

What happens to runs missed while byob wasn’t running.

§keep: u32

How many runs (with their chats) to keep.

§created_at: i64

Milliseconds since the epoch; set by the engine.

Implementations§

Source§

impl Routine

Source

pub fn validated(self) -> Result<Routine, String>

Check an untrusted routine: trims text, refuses what doesn’t fit. The id may be empty (a new routine: the engine makes one); otherwise it must be id_ok.

Source

pub fn schedules( &self, ) -> impl Iterator<Item = (&str, &str, Option<&str>, Option<&str>)>

Its schedules (rule, at, zone, start).

Trait Implementations§

Source§

impl Clone for Routine

Source§

fn clone(&self) -> Routine

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Routine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for Routine

Source§

fn default() -> Routine

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Routine

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Routine, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for Routine

Source§

fn eq(&self, other: &Routine) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Routine

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Routine

Auto Trait Implementations§

§

impl Forget for Routine

§

impl Freeze for Routine

§

impl Move for Routine

§

impl RefUnwindSafe for Routine

§

impl Send for Routine
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for Routine
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for Routine
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for Routine

§

impl UnwindSafe for Routine
where RawVecInner: UnwindSafe, BTreeMap<String, Value>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.