pub struct Frame {
pub id: FrameId,
pub scope: String,
pub constraints: Vec<FrameConstraint>,
pub success_criteria: Vec<Criterion>,
pub linked_intent: Option<IntentId>,
pub parent_frame: Option<FrameId>,
}Expand description
Frame - defines scope and constraints for a phase of reasoning.
Linked to Intent, contains constraints and success criteria.
§Example
use converge_core::types::{Frame, FrameId, FrameConstraint, ConstraintKind, ConstraintSeverity, Criterion};
let frame = Frame::builder()
.id(FrameId::new("frame-1"))
.scope("Nordic B2B market expansion")
.constraints(vec![
FrameConstraint::budget(1_000_000),
FrameConstraint::time("Q4 2025"),
])
.success_criteria(vec![
Criterion::required("roi", "Achieve 20% ROI"),
])
.build();
assert_eq!(frame.id.as_str(), "frame-1");Fields§
§id: FrameIdUnique identifier for this frame.
scope: StringScope description for this frame.
constraints: Vec<FrameConstraint>Constraints that apply to this frame.
success_criteria: Vec<Criterion>Success criteria for this frame.
linked_intent: Option<IntentId>Linked intent (if this frame is for a specific intent).
parent_frame: Option<FrameId>Parent frame (for nested frames).
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn builder() -> FrameBuilder
pub fn builder() -> FrameBuilder
Create a builder for building Frame.
On the builder, call .id(...), .scope(...), .constraints(...)(optional), .success_criteria(...)(optional), .linked_intent(...)(optional), .parent_frame(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of Frame.
Source§impl Frame
impl Frame
Sourcepub fn has_required_criteria(&self) -> bool
pub fn has_required_criteria(&self) -> bool
Check if all required criteria are defined.
Sourcepub fn hard_constraints(&self) -> impl Iterator<Item = &FrameConstraint>
pub fn hard_constraints(&self) -> impl Iterator<Item = &FrameConstraint>
Get hard constraints only.
Sourcepub fn soft_constraints(&self) -> impl Iterator<Item = &FrameConstraint>
pub fn soft_constraints(&self) -> impl Iterator<Item = &FrameConstraint>
Get soft constraints only.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Frame
impl<'de> Deserialize<'de> for Frame
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Frame, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Frame, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Frame
impl Serialize for Frame
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
Auto Trait Implementations§
impl Freeze for Frame
impl RefUnwindSafe for Frame
impl Send for Frame
impl Sync for Frame
impl Unpin for Frame
impl UnsafeUnpin for Frame
impl UnwindSafe for Frame
Blanket Implementations§
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
Mutably borrows from an owned value. Read more