pub struct CommitBuilder { /* private fields */ }Expand description
Builder for creating commits. The commit ID is computed on build.
Implementations§
Source§impl CommitBuilder
impl CommitBuilder
Sourcepub fn new(
state_root: ObjectId,
agent_id: impl Into<AgentId>,
authority: Authority,
intent: Intent,
) -> Self
pub fn new( state_root: ObjectId, agent_id: impl Into<AgentId>, authority: Authority, intent: Intent, ) -> Self
Start building a commit with the required fields.
Sourcepub fn device(self, device: impl Into<DeviceId>) -> Self
pub fn device(self, device: impl Into<DeviceId>) -> Self
Set the device the change was made from. Control characters are
dropped and the id is capped at MAX_DEVICE_LEN chars on build; an
id with nothing printable left is no device.
Sourcepub fn confidence(self, confidence: f64) -> Self
pub fn confidence(self, confidence: f64) -> Self
Set the confidence score.
Sourcepub fn tool_calls(self, calls: Vec<ToolCall>) -> Self
pub fn tool_calls(self, calls: Vec<ToolCall>) -> Self
Add tool calls.
Sourcepub fn build(self) -> Commit
pub fn build(self) -> Commit
Build the commit, computing its content-addressed ID.
Silently truncates overlong provenance fields to their caps —
MAX_DESCRIPTION_LEN, MAX_REASONING_LEN, MAX_AGENT_ID_LEN,
MAX_DEVICE_LEN, MAX_TOOL_CALLS. Truncation uses chars() so UTF-8
codepoints are never split.
Auto Trait Implementations§
impl Forget for CommitBuilder
impl Freeze for CommitBuilder
impl Move for CommitBuilder
impl RefUnwindSafe for CommitBuilder
impl Send for CommitBuilder
impl Sync for CommitBuilder
impl Unpin for CommitBuilder
impl UnsafeUnpin for CommitBuilder
impl UnwindSafe for CommitBuilder
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