pub struct ProjectBehavior { /* private fields */ }Expand description
Behavior implementation for project notes.
Implementations§
Source§impl ProjectBehavior
impl ProjectBehavior
Sourcepub fn new(typedef: Option<Arc<TypeDefinition>>) -> Self
pub fn new(typedef: Option<Arc<TypeDefinition>>) -> Self
Create a new ProjectBehavior, optionally wrapping a Lua typedef override.
Trait Implementations§
Source§impl NoteBehavior for ProjectBehavior
impl NoteBehavior for ProjectBehavior
Source§impl NoteIdentity for ProjectBehavior
impl NoteIdentity for ProjectBehavior
Source§fn generate_id(&self, ctx: &CreationContext<'_>) -> DomainResult<Option<String>>
fn generate_id(&self, ctx: &CreationContext<'_>) -> DomainResult<Option<String>>
Generate a unique ID for this note type.
Returns None if this type doesn’t use IDs (e.g., daily notes use dates).
Source§fn output_path(&self, ctx: &CreationContext<'_>) -> DomainResult<PathBuf>
fn output_path(&self, ctx: &CreationContext<'_>) -> DomainResult<PathBuf>
Determine the output path for this note.
This is called after prompts are collected and before_create runs.
Source§fn core_fields(&self) -> Vec<&'static str>
fn core_fields(&self) -> Vec<&'static str>
Get the fields that this type manages (core metadata).
These fields will be preserved through template/hook modifications.
Source§impl NoteLifecycle for ProjectBehavior
impl NoteLifecycle for ProjectBehavior
Source§fn before_create(&self, ctx: &mut CreationContext<'_>) -> DomainResult<()>
fn before_create(&self, ctx: &mut CreationContext<'_>) -> DomainResult<()>
Called before the note is written to disk.
Can modify the context (e.g., set computed vars, update counters).
Source§fn after_create(
&self,
ctx: &CreationContext<'_>,
_content: &str,
) -> DomainResult<()>
fn after_create( &self, ctx: &CreationContext<'_>, _content: &str, ) -> DomainResult<()>
Called after the note is successfully written to disk.
Used for side effects (logging to daily, reindexing, etc.).
Source§impl NotePrompts for ProjectBehavior
impl NotePrompts for ProjectBehavior
Source§fn type_prompts(&self, ctx: &PromptContext<'_>) -> Vec<FieldPrompt>
fn type_prompts(&self, ctx: &PromptContext<'_>) -> Vec<FieldPrompt>
Return type-specific prompts (e.g., project selector for tasks).
These run BEFORE schema-based prompts.
Source§fn should_prompt_schema(&self) -> bool
fn should_prompt_schema(&self) -> bool
Whether this type should prompt for schema fields.
Default: true. Override to false for types that compute all fields.
Auto Trait Implementations§
impl Freeze for ProjectBehavior
impl RefUnwindSafe for ProjectBehavior
impl Send for ProjectBehavior
impl Sync for ProjectBehavior
impl Unpin for ProjectBehavior
impl UnsafeUnpin for ProjectBehavior
impl UnwindSafe for ProjectBehavior
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
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>
Converts
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>
Converts
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 more