pub struct Intent { /* private fields */ }Expand description
Immutable request/spec revision.
One stored Intent answers “what request revision existed here?”.
It does not answer “what is the current thread head?” or “which plan
is currently selected?” because those are Libra projection concerns.
Implementations§
Source§impl Intent
impl Intent
Sourcepub fn new(
created_by: ActorRef,
prompt: impl Into<String>,
) -> Result<Self, String>
pub fn new( created_by: ActorRef, prompt: impl Into<String>, ) -> Result<Self, String>
Create a new root intent revision from a free-form user prompt.
Sourcepub fn new_revision_from(
created_by: ActorRef,
prompt: impl Into<String>,
parent: &Self,
) -> Result<Self, String>
pub fn new_revision_from( created_by: ActorRef, prompt: impl Into<String>, parent: &Self, ) -> Result<Self, String>
Create a new intent revision from a single parent intent.
This is the common helper for linear refinement.
Sourcepub fn new_revision_chain(
created_by: ActorRef,
prompt: impl Into<String>,
parent_ids: &[Uuid],
) -> Result<Self, String>
pub fn new_revision_chain( created_by: ActorRef, prompt: impl Into<String>, parent_ids: &[Uuid], ) -> Result<Self, String>
Create a new intent revision from multiple parent intents.
Use this when Libra merges several prior intent branches into a new request/spec revision.
Sourcepub fn spec(&self) -> Option<&IntentSpec>
pub fn spec(&self) -> Option<&IntentSpec>
Return the structured request payload, if one was stored.
Sourcepub fn analysis_context_frames(&self) -> &[Uuid]
pub fn analysis_context_frames(&self) -> &[Uuid]
Return the analysis-time context frame ids frozen onto this revision.
Sourcepub fn add_parent(&mut self, parent_id: Uuid)
pub fn add_parent(&mut self, parent_id: Uuid)
Add one parent link if it is not already present and is not self.
Sourcepub fn set_parents(&mut self, parents: Vec<Uuid>)
pub fn set_parents(&mut self, parents: Vec<Uuid>)
Replace the parent set for this in-memory revision before persistence.
Sourcepub fn set_spec(&mut self, spec: Option<IntentSpec>)
pub fn set_spec(&mut self, spec: Option<IntentSpec>)
Set or clear the structured spec for this in-memory revision.
Sourcepub fn set_analysis_context_frames(
&mut self,
analysis_context_frames: Vec<Uuid>,
)
pub fn set_analysis_context_frames( &mut self, analysis_context_frames: Vec<Uuid>, )
Replace the analysis-time context frame set for this in-memory revision before persistence.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Intent
impl<'de> Deserialize<'de> for Intent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl ObjectTrait for Intent
impl ObjectTrait for Intent
Source§fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
Source§fn get_type(&self) -> ObjectType
fn get_type(&self) -> ObjectType
fn get_size(&self) -> usize
fn to_data(&self) -> Result<Vec<u8>, GitError>
Source§fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Selfwhere
Self: Sized,
fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Selfwhere
Self: Sized,
ReadBoxed<BufRead>.
the input size,is only for new a vec with directive space allocation
the input data stream and output object should be plain base object .fn object_hash(&self) -> Result<ObjectHash, GitError>
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnsafeUnpin for Intent
impl UnwindSafe for Intent
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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§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.