pub struct InstructionSpecBuilder { /* private fields */ }Expand description
Builder for InstructionSpec.
Implementations§
Source§impl InstructionSpecBuilder
impl InstructionSpecBuilder
Sourcepub fn adopt_unowned(self, adopt: bool) -> Self
pub fn adopt_unowned(self, adopt: bool) -> Self
Adopt an instruction file (or include block) that exists on disk but
has no recorded owner. See InstructionSpec::adopt_unowned.
Sourcepub fn placement(self, p: InstructionPlacement) -> Self
pub fn placement(self, p: InstructionPlacement) -> Self
Set the placement mode. Defaults to ReferencedFile.
Sourcepub fn body(self, body: impl Into<String>) -> Self
pub fn body(self, body: impl Into<String>) -> Self
Set the markdown body. Required, must not be empty/whitespace.
Sourcepub fn build(self) -> InstructionSpec
pub fn build(self) -> InstructionSpec
Consume the builder and return an InstructionSpec.
§Panics
Panics if required fields are missing or validation fails.
Sourcepub fn try_build(self) -> Result<InstructionSpec, AgentConfigError>
pub fn try_build(self) -> Result<InstructionSpec, AgentConfigError>
Consume the builder and return an InstructionSpec, or an error
if required fields are missing or validation fails.
§Errors
AgentConfigError::MissingSpecFieldwithfield = "owner"whenInstructionSpecBuilder::ownerwas never called, orfield = "body"when the body is empty/whitespace-only.AgentConfigError::InvalidTagwhennameorowner_tagcontain characters outside ASCII alnum /_/-.
Trait Implementations§
Source§impl Clone for InstructionSpecBuilder
impl Clone for InstructionSpecBuilder
Source§fn clone(&self) -> InstructionSpecBuilder
fn clone(&self) -> InstructionSpecBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InstructionSpecBuilder
impl RefUnwindSafe for InstructionSpecBuilder
impl Send for InstructionSpecBuilder
impl Sync for InstructionSpecBuilder
impl Unpin for InstructionSpecBuilder
impl UnsafeUnpin for InstructionSpecBuilder
impl UnwindSafe for InstructionSpecBuilder
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