Skip to main content

Message

Enum Message 

Source
pub enum Message {
Show 310 variants AutostartEnabled, AutostartEnabledUser, AutostartDisabled, AutostartAlreadyDisabled, AutostartEnableFailed(String), AutostartDisableFailed(String), AutostartStatus(String), AutostartNotImplemented, AutostartRequiresAdmin, AutostartCheckingAlternative, TaskCreated, TaskUpdated, TaskDeleted, TaskNotFound, TaskCreateFailed, TaskUpdateFailed, TaskDeleteFailed, TasksDeletedCount(usize), TasksNotFoundForDate(String), TasksNotFoundSad, TasksHeader, TasksIncompleteHeader, TasksGitlabHeader, TasksJiraHeader, TasksDiscoverySummary { incomplete: usize, jira: usize, gitlab: usize, }, TasksDiscoverySeparator, TasksDiscoverySearchingIncomplete, TasksDiscoveryFetchingExternal, NoTaskIdsProvided, TasksNotFoundForIds(Vec<i32>), TasksToBeDeleted, ConfirmDeleteTask, ConfirmDeleteTasks(usize), ConfirmDeleteAllTodayTasks(usize), ConfirmDeleteAllTodayTasksFinal, NoTasksForToday, TaskNotFoundWithId(i32), CurrentTaskState, TaskEditPreview, ConfirmTaskUpdate, NoChangesDetected, NoTasksSelected, SelectTasksToEdit, EditingTask(String), TaskUpdatedWithName(String), TaskSkippedNoChanges(String), TaskEditingCompleted, PromptTaskNameEdit, PromptTaskCommentEdit, PromptTaskCompletenessEdit, TaskCompletenessRange, WorkdayEnded, WorkdayNotFound, WorkdayNotFoundForDate(String), WorkdayCreateFailed, WorkdayStarting(String), WorkdayCouldNotFindAfterFinalizing(String), ConfigSaved, ConfigDeleted, ConfigLoaded, ConfigFileNotFound, ConfigParseError, ConfigSaveError, ConfigModuleGitLab, ConfigModuleJira, ConfigModuleSiServer, ConfigModuleMonitor, ConfigModuleServer, ConfigModuleProductivity, ConfigModuleTaskDiscovery, ConfigModuleJiraInbox, TaskDiscoveryIgnoreListHeader, TaskDiscoveryIgnoreListEmpty, TaskDiscoveryIgnoreNameAdded(String), TaskDiscoveryIgnoreNameExists(String), TaskDiscoveryIgnoreNamesAdded(usize), DailyReportSent(String), MonthlyReportSent(String), MonthlyReportTriggered, ReportSendFailed(String), MonthlyReportSendFailed(String), ReportHeader(String), WorkingHoursForMonth(String), ExportingData(String, String), ExportCompleted(String), ExportingAllData, ExportFailed(String), TemplateCreated(String), TemplateUpdated(String), TemplateDeleted(String), TemplateNotFound(String), TemplateAlreadyExists(String), TemplateCreateFailed, NoTemplatesFound, TemplateListHeader, SelectTemplateToEdit, SelectTemplateToDelete, ConfirmDeleteTemplate(String), EditingTemplate(String), NoTemplatesMatchingQuery(String), TemplateSearchResults(String), SelectTemplateAction, PromptTemplateName, PromptTemplateTaskName, PromptTemplateComment, PromptTemplateCompleteness, CreatingTaskFromTemplate(String), SelectTemplate, CreateTemplateFirst, TagCreated(String), TagUpdated(String), TagDeleted(String), TagNotFound(String), TagAlreadyExists(String), NoTagsFound, TagListHeader, EditingTag(String), SelectTagAction, SelectTagToEdit, SelectTagToDelete, ConfirmDeleteTag(String), ConfirmDeleteTagWithTasks(String, usize), PromptTagName, PromptTagColor, NoTasksWithTag(String), TasksWithTag(String), TagsAddedToTask(String), ShortIntervalsDetected(usize, String), NoShortIntervalsFound(u64), ShortIntervalsToRemove(usize), RemovingPauses(usize), ShortIntervalsCleared(usize), NoRemovablePausesFound, UpdatedReport, PromptMinWorkInterval, SelectAdjustmentMode, PromptAdjustmentMinutes, PromptPauseStartTime, ConfirmTimeAdjustment, TimeAdjustmentApplied, AdjustmentPreview, InvalidAdjustmentTooMuchTime, InvalidPauseOutsideWorkday, WorkdayUpdateFailed, PausesTitle(String), MonitorStarted { pause_threshold: u64, poll_interval: u64, activity_threshold: u64, }, MonitorStopped, MonitorStartFailed, MonitorStopFailed, MonitorExitedNormally, MonitorShuttingDown, MonitorError(String), MonitorTaskPanicked(String), PauseStarted, PauseEnded, WatcherStarted(u32), WatcherStopped(u32), WatcherStoppedSuccessfully, WatcherNotRunning, WatcherNotRunningPidNotFound, WatcherStartingForeground, WatcherStoppingExisting(String), WatcherFailedToStopExisting(String), WatcherFailedToStop(u32), WatcherReceivedSigterm, WatcherReceivedSigint, WatcherReceivedCtrlC, WatcherCtrlCListenFailed(String), WatcherSignalHandlingNotSupported, DaemonModeNotSupported, FailedToGetCurrentExecutable, FailedToCreateSigtermHandler, FailedToCreateSigintHandler, UpdateAvailable { app_name: String, latest: String, }, UpdateCompleted { app_name: String, version: String, }, NoUpdateRequired, UpdateDownloadUrlNotSet, WatcherStoppingForUpdate, WatcherRestartingAfterUpdate, WatcherStoppingForConfig, WatcherRestartingAfterConfig, WatcherRestarted, WatcherRestartFailed { error: String, }, UpdateBinaryNotFoundInArchive, WrongPassword(i32), InvalidCredentials, SessionExpired, AuthenticationFailed(String), JiraAuthenticateFailed, LoginFailed, CredentialsNotSet, ApiConnectionFailed, ApiAuthFailed, ApiRequestFailed, GitlabFetchFailed(String), GitlabUserIdFailed(String), JiraFetchFailed(String), SiServerConfigNotFound, SiServerSessionFailed(String), SiServerRestDatesFailed(String), SiServerRestDatesParsingFailed(String), DbConnectionFailed, DbQueryFailed, DbMigrationFailed, DatabaseOperationFailed { operation: String, error: String, }, NoIdSet, FileNotFound, FileReadError, FileWriteError, InvalidPidFileContent, DataStoragePathError, PathConfigured, PathConfigWarning { error: String, }, PathQueryFailed(String), PathSetFailed, PathRegistryQueryError { status: String, }, PathRegistryUpdateError { status: String, stderr: String, }, FailedToJoinPaths, FailedToExecuteRegQuery, FailedToParseRegOutput, FailedToGetPathFromReg, FailedToExecuteRegSet, FailedToOpenProcess(u32), FailedToTerminateProcess(u32), ProcessNotFound, ProcessTerminationNotSupported, MonthlyProductivity(f64), LowProductivityWarning { current: f64, threshold: f64, }, ProductivityTooLowToSend { current: f64, threshold: f64, }, ManualPauseCreated { start_time: String, end_time: String, duration_minutes: u64, }, ManualPauseOverlaps { start_time: String, end_time: String, }, ManualPauseRemoved(i32), ManualPauseNotFound(i32), ProductivityRecalculated(f64), EncryptionKeyMustBeSet, EncryptionIvMustBeSet, PromptTaskName, TaskNameMergedFromPaste, PromptTaskComment, PromptTaskCompleteness, PromptGitlabToken, PromptGitlabUrl, PromptJiraLogin, PromptJiraUrl, PromptJiraPassword, PromptSiLogin, PromptSiAuthUrl, PromptSiApiUrl, PromptSiPassword, PromptMinPauseDuration, PromptPauseThreshold, PromptPollInterval, PromptActivityThreshold, PromptMinProductivityThreshold, PromptWorkdayHours, PromptMinWorkdayFraction, PromptServerApiUrl, PromptServerAuthToken, PromptConfirmDelete, PromptSelectOptions, PromptSelectModules, PromptSelectTasks, PromptSelectTasksToEdit, PromptSelectTasksToImport, PromptSelectTasksToIgnore, PromptSelectIgnoreNamesToRemove, PromptAddIgnoreName, OperationCompleted, OperationCancelled, DataExported, BackupCreated, InvalidInput, PermissionDenied, ErrorSendingEvents(String), ErrorSendingMonthlyReport(String), ErrorInRdevListener(String), ErrorRequestingRestDates(String), SelectingTask(String), SelectedTaskFormat(String, i32), JiraInboxRequiresJiraConfig, JiraInboxEmpty, JiraInboxListHeader, JiraInboxSynced { fetched: usize, new_count: usize, updated: usize, }, JiraInboxNewIssues(usize), JiraInboxNotFound(String), JiraInboxPinned(String), JiraInboxUnpinned(String), JiraInboxDismissed(String), JiraInboxOpened(String), JiraInboxTaken(String), JiraInboxOpenFailed(String), PromptJiraInboxEnabled, PromptJiraInboxPollInterval, PromptJiraInboxNotify, PromptJiraInboxSortFieldId, PromptJiraInboxSortFieldLabel, PromptJiraInboxExtraFieldId, PromptJiraInboxExtraFieldLabel, MigrationsFound(usize), RunningMigration(u32, String), MigrationCompleted(u32), MigrationFailed(u32, String), AllMigrationsCompleted, DatabaseVersion(u32), DatabaseUpToDate, DatabaseNeedsUpdate, MigrationHistory, NothingToRollback, RollingBack(u32, u32), RollbackCompleted(u32),
}
Expand description

Comprehensive message enumeration for all user-facing communication.

This enum represents every type of message that the kasl application can present to users. It provides a type-safe way to handle all application communication while ensuring consistent formatting and proper parameter handling across all components.

ยงMessage Categories

The enum is organized into logical categories that correspond to different areas of application functionality. Each category groups related messages to improve maintainability and make it easier to understand the scope of each functional area.

ยงParameter Conventions

  • String Parameters: Used for names, descriptions, and user-provided text
  • Numeric Parameters: Used for counts, IDs, and measurements
  • Status Parameters: Used for system states and operation results
  • Structured Parameters: Named fields for complex message data

ยงAdding New Messages

When adding new message variants:

  1. Choose the appropriate category section
  2. Use descriptive names that clearly indicate the message purpose
  3. Include necessary parameters with appropriate types
  4. Add corresponding text in the Display implementation
  5. Document the message purpose and usage context

ยงBackward Compatibility

The enum is designed to maintain backward compatibility:

  • New variants can be added without breaking existing code
  • Parameter changes should be additive when possible
  • Deprecated messages can be maintained for transition periods

Variantsยง

ยง

AutostartEnabled

ยง

AutostartEnabledUser

ยง

AutostartDisabled

ยง

AutostartAlreadyDisabled

ยง

AutostartEnableFailed(String)

ยง

AutostartDisableFailed(String)

ยง

AutostartStatus(String)

ยง

AutostartNotImplemented

ยง

AutostartRequiresAdmin

ยง

AutostartCheckingAlternative

ยง

TaskCreated

ยง

TaskUpdated

ยง

TaskDeleted

ยง

TaskNotFound

ยง

TaskCreateFailed

ยง

TaskUpdateFailed

ยง

TaskDeleteFailed

ยง

TasksDeletedCount(usize)

ยง

TasksNotFoundForDate(String)

ยง

TasksNotFoundSad

ยง

TasksHeader

ยง

TasksIncompleteHeader

ยง

TasksGitlabHeader

ยง

TasksJiraHeader

ยง

TasksDiscoverySummary

Summary line before unified discovery MultiSelect

Fields

ยงincomplete: usize
ยงgitlab: usize
ยง

TasksDiscoverySeparator

Non-selectable separator between incomplete and other items

ยง

TasksDiscoverySearchingIncomplete

ยง

TasksDiscoveryFetchingExternal

ยง

NoTaskIdsProvided

ยง

TasksNotFoundForIds(Vec<i32>)

ยง

TasksToBeDeleted

ยง

ConfirmDeleteTask

ยง

ConfirmDeleteTasks(usize)

ยง

ConfirmDeleteAllTodayTasks(usize)

ยง

ConfirmDeleteAllTodayTasksFinal

ยง

NoTasksForToday

ยง

TaskNotFoundWithId(i32)

ยง

CurrentTaskState

ยง

TaskEditPreview

ยง

ConfirmTaskUpdate

ยง

NoChangesDetected

ยง

NoTasksSelected

ยง

SelectTasksToEdit

ยง

EditingTask(String)

ยง

TaskUpdatedWithName(String)

ยง

TaskSkippedNoChanges(String)

ยง

TaskEditingCompleted

ยง

PromptTaskNameEdit

ยง

PromptTaskCommentEdit

ยง

PromptTaskCompletenessEdit

ยง

TaskCompletenessRange

ยง

WorkdayEnded

ยง

WorkdayNotFound

ยง

WorkdayNotFoundForDate(String)

ยง

WorkdayCreateFailed

ยง

WorkdayStarting(String)

ยง

WorkdayCouldNotFindAfterFinalizing(String)

ยง

ConfigSaved

ยง

ConfigDeleted

ยง

ConfigLoaded

ยง

ConfigFileNotFound

ยง

ConfigParseError

ยง

ConfigSaveError

ยง

ConfigModuleGitLab

ยง

ConfigModuleJira

ยง

ConfigModuleSiServer

ยง

ConfigModuleMonitor

ยง

ConfigModuleServer

ยง

ConfigModuleProductivity

ยง

ConfigModuleTaskDiscovery

ยง

ConfigModuleJiraInbox

ยง

TaskDiscoveryIgnoreListHeader

ยง

TaskDiscoveryIgnoreListEmpty

ยง

TaskDiscoveryIgnoreNameAdded(String)

ยง

TaskDiscoveryIgnoreNameExists(String)

ยง

TaskDiscoveryIgnoreNamesAdded(usize)

ยง

DailyReportSent(String)

ยง

MonthlyReportSent(String)

ยง

MonthlyReportTriggered

ยง

ReportSendFailed(String)

ยง

MonthlyReportSendFailed(String)

ยง

ReportHeader(String)

ยง

WorkingHoursForMonth(String)

ยง

ExportingData(String, String)

ยง

ExportCompleted(String)

ยง

ExportingAllData

ยง

ExportFailed(String)

ยง

TemplateCreated(String)

ยง

TemplateUpdated(String)

ยง

TemplateDeleted(String)

ยง

TemplateNotFound(String)

ยง

TemplateAlreadyExists(String)

ยง

TemplateCreateFailed

ยง

NoTemplatesFound

ยง

TemplateListHeader

ยง

SelectTemplateToEdit

ยง

SelectTemplateToDelete

ยง

ConfirmDeleteTemplate(String)

ยง

EditingTemplate(String)

ยง

NoTemplatesMatchingQuery(String)

ยง

TemplateSearchResults(String)

ยง

SelectTemplateAction

ยง

PromptTemplateName

ยง

PromptTemplateTaskName

ยง

PromptTemplateComment

ยง

PromptTemplateCompleteness

ยง

CreatingTaskFromTemplate(String)

ยง

SelectTemplate

ยง

CreateTemplateFirst

ยง

TagCreated(String)

ยง

TagUpdated(String)

ยง

TagDeleted(String)

ยง

TagNotFound(String)

ยง

TagAlreadyExists(String)

ยง

NoTagsFound

ยง

TagListHeader

ยง

EditingTag(String)

ยง

SelectTagAction

ยง

SelectTagToEdit

ยง

SelectTagToDelete

ยง

ConfirmDeleteTag(String)

ยง

ConfirmDeleteTagWithTasks(String, usize)

ยง

PromptTagName

ยง

PromptTagColor

ยง

NoTasksWithTag(String)

ยง

TasksWithTag(String)

ยง

TagsAddedToTask(String)

ยง

ShortIntervalsDetected(usize, String)

ยง

NoShortIntervalsFound(u64)

ยง

ShortIntervalsToRemove(usize)

ยง

RemovingPauses(usize)

ยง

ShortIntervalsCleared(usize)

ยง

NoRemovablePausesFound

ยง

UpdatedReport

ยง

PromptMinWorkInterval

ยง

SelectAdjustmentMode

ยง

PromptAdjustmentMinutes

ยง

PromptPauseStartTime

ยง

ConfirmTimeAdjustment

ยง

TimeAdjustmentApplied

ยง

AdjustmentPreview

ยง

InvalidAdjustmentTooMuchTime

ยง

InvalidPauseOutsideWorkday

ยง

WorkdayUpdateFailed

ยง

PausesTitle(String)

ยง

MonitorStarted

Fields

ยงpause_threshold: u64
ยงpoll_interval: u64
ยงactivity_threshold: u64
ยง

MonitorStopped

ยง

MonitorStartFailed

ยง

MonitorStopFailed

ยง

MonitorExitedNormally

ยง

MonitorShuttingDown

ยง

MonitorError(String)

ยง

MonitorTaskPanicked(String)

ยง

PauseStarted

ยง

PauseEnded

ยง

WatcherStarted(u32)

ยง

WatcherStopped(u32)

ยง

WatcherStoppedSuccessfully

ยง

WatcherNotRunning

ยง

WatcherNotRunningPidNotFound

ยง

WatcherStartingForeground

ยง

WatcherStoppingExisting(String)

ยง

WatcherFailedToStopExisting(String)

ยง

WatcherFailedToStop(u32)

ยง

WatcherReceivedSigterm

ยง

WatcherReceivedSigint

ยง

WatcherReceivedCtrlC

ยง

WatcherCtrlCListenFailed(String)

ยง

WatcherSignalHandlingNotSupported

ยง

DaemonModeNotSupported

ยง

FailedToGetCurrentExecutable

ยง

FailedToCreateSigtermHandler

ยง

FailedToCreateSigintHandler

ยง

UpdateAvailable

Fields

ยงapp_name: String
ยงlatest: String
ยง

UpdateCompleted

Fields

ยงapp_name: String
ยงversion: String
ยง

NoUpdateRequired

ยง

UpdateDownloadUrlNotSet

ยง

WatcherStoppingForUpdate

ยง

WatcherRestartingAfterUpdate

ยง

WatcherStoppingForConfig

ยง

WatcherRestartingAfterConfig

ยง

WatcherRestarted

ยง

WatcherRestartFailed

Fields

ยง

UpdateBinaryNotFoundInArchive

ยง

WrongPassword(i32)

ยง

InvalidCredentials

ยง

SessionExpired

ยง

AuthenticationFailed(String)

ยง

JiraAuthenticateFailed

ยง

LoginFailed

ยง

CredentialsNotSet

ยง

ApiConnectionFailed

ยง

ApiAuthFailed

ยง

ApiRequestFailed

ยง

GitlabFetchFailed(String)

ยง

GitlabUserIdFailed(String)

ยง

JiraFetchFailed(String)

ยง

SiServerConfigNotFound

ยง

SiServerSessionFailed(String)

ยง

SiServerRestDatesFailed(String)

ยง

SiServerRestDatesParsingFailed(String)

ยง

DbConnectionFailed

ยง

DbQueryFailed

ยง

DbMigrationFailed

ยง

DatabaseOperationFailed

Fields

ยงoperation: String
ยง

NoIdSet

ยง

FileNotFound

ยง

FileReadError

ยง

FileWriteError

ยง

InvalidPidFileContent

ยง

DataStoragePathError

ยง

PathConfigured

ยง

PathConfigWarning

Fields

ยง

PathQueryFailed(String)

ยง

PathSetFailed

ยง

PathRegistryQueryError

Fields

ยงstatus: String
ยง

PathRegistryUpdateError

Fields

ยงstatus: String
ยงstderr: String
ยง

FailedToJoinPaths

ยง

FailedToExecuteRegQuery

ยง

FailedToParseRegOutput

ยง

FailedToGetPathFromReg

ยง

FailedToExecuteRegSet

ยง

FailedToOpenProcess(u32)

ยง

FailedToTerminateProcess(u32)

ยง

ProcessNotFound

ยง

ProcessTerminationNotSupported

ยง

MonthlyProductivity(f64)

ยง

LowProductivityWarning

Fields

ยงcurrent: f64
ยงthreshold: f64
ยง

ProductivityTooLowToSend

Fields

ยงcurrent: f64
ยงthreshold: f64
ยง

ManualPauseCreated

Fields

ยงstart_time: String
ยงend_time: String
ยงduration_minutes: u64
ยง

ManualPauseOverlaps

Fields

ยงstart_time: String
ยงend_time: String
ยง

ManualPauseRemoved(i32)

ยง

ManualPauseNotFound(i32)

ยง

ProductivityRecalculated(f64)

ยง

EncryptionKeyMustBeSet

ยง

EncryptionIvMustBeSet

ยง

PromptTaskName

ยง

TaskNameMergedFromPaste

ยง

PromptTaskComment

ยง

PromptTaskCompleteness

ยง

PromptGitlabToken

ยง

PromptGitlabUrl

ยง

PromptJiraLogin

ยง

PromptJiraUrl

ยง

PromptJiraPassword

ยง

PromptSiLogin

ยง

PromptSiAuthUrl

ยง

PromptSiApiUrl

ยง

PromptSiPassword

ยง

PromptMinPauseDuration

ยง

PromptPauseThreshold

ยง

PromptPollInterval

ยง

PromptActivityThreshold

ยง

PromptMinProductivityThreshold

ยง

PromptWorkdayHours

ยง

PromptMinWorkdayFraction

ยง

PromptServerApiUrl

ยง

PromptServerAuthToken

ยง

PromptConfirmDelete

ยง

PromptSelectOptions

ยง

PromptSelectModules

ยง

PromptSelectTasks

ยง

PromptSelectTasksToEdit

ยง

PromptSelectTasksToImport

ยง

PromptSelectTasksToIgnore

ยง

PromptSelectIgnoreNamesToRemove

ยง

PromptAddIgnoreName

ยง

OperationCompleted

ยง

OperationCancelled

ยง

DataExported

ยง

BackupCreated

ยง

InvalidInput

ยง

PermissionDenied

ยง

ErrorSendingEvents(String)

ยง

ErrorSendingMonthlyReport(String)

ยง

ErrorInRdevListener(String)

ยง

ErrorRequestingRestDates(String)

ยง

SelectingTask(String)

ยง

SelectedTaskFormat(String, i32)

ยง

JiraInboxRequiresJiraConfig

ยง

JiraInboxEmpty

ยง

JiraInboxListHeader

ยง

JiraInboxSynced

Fields

ยงfetched: usize
ยงnew_count: usize
ยงupdated: usize
ยง

JiraInboxNewIssues(usize)

ยง

JiraInboxNotFound(String)

ยง

JiraInboxPinned(String)

ยง

JiraInboxUnpinned(String)

ยง

JiraInboxDismissed(String)

ยง

JiraInboxOpened(String)

ยง

JiraInboxTaken(String)

ยง

JiraInboxOpenFailed(String)

ยง

PromptJiraInboxEnabled

ยง

PromptJiraInboxPollInterval

ยง

PromptJiraInboxNotify

ยง

PromptJiraInboxSortFieldId

ยง

PromptJiraInboxSortFieldLabel

ยง

PromptJiraInboxExtraFieldId

ยง

PromptJiraInboxExtraFieldLabel

ยง

MigrationsFound(usize)

ยง

RunningMigration(u32, String)

ยง

MigrationCompleted(u32)

ยง

MigrationFailed(u32, String)

ยง

AllMigrationsCompleted

ยง

DatabaseVersion(u32)

ยง

DatabaseUpToDate

ยง

DatabaseNeedsUpdate

ยง

MigrationHistory

ยง

NothingToRollback

ยง

RollingBack(u32, u32)

ยง

RollbackCompleted(u32)

Trait Implementationsยง

Sourceยง

impl Clone for Message

Sourceยง

fn clone(&self) -> Message

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Debug for Message

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl Display for Message

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Converts a Message enum variant into human-readable text.

This method implements the core message-to-text conversion logic for the entire kasl application. It provides consistent, professional text formatting for all user-facing messages while maintaining type safety and parameter interpolation.

ยงImplementation Strategy

The method uses a comprehensive match statement to handle each message variant individually, ensuring that:

  • All message types are explicitly handled
  • Parameter interpolation is type-safe
  • Text formatting is consistent across message categories
  • New message types require explicit formatting decisions
ยงText Quality Standards

All generated text adheres to these quality standards:

  • Clarity: Messages are easily understood by users
  • Specificity: Include relevant details and context
  • Actionability: Provide guidance for next steps when appropriate
  • Professionalism: Suitable for business and personal environments
  • Consistency: Uniform tone and style across all messages
ยงParameter Handling

Messages with parameters use safe string interpolation:

  • String parameters are inserted directly
  • Numeric parameters are formatted appropriately
  • Collections are joined with appropriate separators
  • Optional values are handled with meaningful defaults
ยงError Message Philosophy

Error messages are designed to be helpful rather than technical:

  • Focus on user-understandable problems
  • Suggest concrete resolution steps
  • Avoid intimidating technical jargon
  • Provide sufficient context for troubleshooting
ยงArguments
  • f - The formatter for writing the text output
ยงReturns

Returns Ok(()) if the message was successfully formatted, or an error if the formatting operation fails.

ยงError Scenarios
  • Formatter Errors: Underlying write operations fail
  • Memory Allocation: Insufficient memory for string operations
  • Parameter Formatting: Invalid parameter values (rare)
ยงExamples
use kasl::libs::messages::Message;

// Automatic formatting through Display trait
let message = Message::TaskCreated;
println!("{}", message); // "Task created successfully"

// With parameters
let date_message = Message::WorkdayStarting("2025-01-15".to_string());
println!("{}", date_message); // "Starting workday for 2025-01-15"

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Sourceยง

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self> โ“˜

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self> โ“˜

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> PolicyExt for T
where T: ?Sized,

Sourceยง

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Sourceยง

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Sourceยง

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T> ToString for T
where T: Display + ?Sized,

Sourceยง

fn to_string(&self) -> String

Converts the given value to a String. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> โ“˜
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self> โ“˜

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more