pub enum ManagerIntentOp<Id, Source, Format, Change> {
Show 38 variants
AddSources {
requests: Vec<Source>,
},
SetDraft {
draft: String,
},
InsertText {
text: String,
},
SetOutputDraft {
draft: String,
},
SetInputDraft {
draft: String,
},
SourceMetadata {
id: Id,
media_id: String,
title: Option<String>,
},
FormatCatalog {
id: Id,
event: FormatDiscoveryOp<Format>,
},
Rehearsal {
id: Id,
event: RehearsalObservationOp<Change>,
},
Transfer {
id: Id,
event: TransferObservationOp,
},
OpenAddSources {},
SubmitDraft {},
DeleteBeforeCursor {},
DeleteAtCursor {},
MoveCursorLeft {},
MoveCursorRight {},
MoveCursorHome {},
MoveCursorEnd {},
SelectPrevious {},
SelectNext {},
OpenSelected {},
SelectPreviousDetail {},
SelectNextDetail {},
ActivateDetail {},
OpenFormats {},
OpenOutput {},
OpenInput {},
SubmitInput {},
OpenReport {},
ToggleDryRun {},
SubmitOutput {},
Back {},
ApplySelectedSpace {},
SelectPreviousFormat {},
SelectNextFormat {},
DuplicateSelected {},
RemoveSelected {},
RestartSelected {},
SafeExitRequested {},
}Expand description
Represents one ManagerIntent operation as pure data.
Variants§
AddSources
Represents the add_sources operation.
SetDraft
Represents the set_draft operation.
InsertText
Represents the insert_text operation.
SetOutputDraft
Represents the set_output_draft operation.
SetInputDraft
Represents the set_input_draft operation.
SourceMetadata
Represents the source_metadata operation.
Fields
id: IdCarries the id argument.
FormatCatalog
Represents the format_catalog operation.
Rehearsal
Represents the rehearsal operation.
Fields
id: IdCarries the id argument.
event: RehearsalObservationOp<Change>Carries the event argument.
Transfer
Represents the transfer operation.
OpenAddSources
Represents the open_add_sources operation.
SubmitDraft
Represents the submit_draft operation.
DeleteBeforeCursor
Represents the delete_before_cursor operation.
DeleteAtCursor
Represents the delete_at_cursor operation.
MoveCursorLeft
Represents the move_cursor_left operation.
MoveCursorRight
Represents the move_cursor_right operation.
MoveCursorHome
Represents the move_cursor_home operation.
MoveCursorEnd
Represents the move_cursor_end operation.
SelectPrevious
Represents the select_previous operation.
SelectNext
Represents the select_next operation.
OpenSelected
Represents the open_selected operation.
SelectPreviousDetail
Represents the select_previous_detail operation.
SelectNextDetail
Represents the select_next_detail operation.
ActivateDetail
Represents the activate_detail operation.
OpenFormats
Represents the open_formats operation.
OpenOutput
Represents the open_output operation.
OpenInput
Represents the open_input operation.
SubmitInput
Represents the submit_input operation.
OpenReport
Represents the open_report operation.
ToggleDryRun
Represents the toggle_dry_run operation.
SubmitOutput
Represents the submit_output operation.
Back
Represents the back operation.
ApplySelectedSpace
Represents the apply_selected_space operation.
SelectPreviousFormat
Represents the select_previous_format operation.
SelectNextFormat
Represents the select_next_format operation.
DuplicateSelected
Represents the duplicate_selected operation.
RemoveSelected
Represents the remove_selected operation.
RestartSelected
Represents the restart_selected operation.
SafeExitRequested
Represents the safe_exit_requested operation.
Implementations§
Source§impl<Id, Source, Format, Change> ManagerIntentOp<Id, Source, Format, Change>
impl<Id, Source, Format, Change> ManagerIntentOp<Id, Source, Format, Change>
Sourcepub fn add_sources(requests: Vec<Source>) -> Self
pub fn add_sources(requests: Vec<Source>) -> Self
Constructs the add_sources operation.
Sourcepub fn insert_text(text: String) -> Self
pub fn insert_text(text: String) -> Self
Constructs the insert_text operation.
Sourcepub fn set_output_draft(draft: String) -> Self
pub fn set_output_draft(draft: String) -> Self
Constructs the set_output_draft operation.
Sourcepub fn set_input_draft(draft: String) -> Self
pub fn set_input_draft(draft: String) -> Self
Constructs the set_input_draft operation.
Sourcepub fn source_metadata(id: Id, media_id: String, title: Option<String>) -> Self
pub fn source_metadata(id: Id, media_id: String, title: Option<String>) -> Self
Constructs the source_metadata operation.
Sourcepub fn format_catalog(id: Id, event: FormatDiscoveryOp<Format>) -> Self
pub fn format_catalog(id: Id, event: FormatDiscoveryOp<Format>) -> Self
Constructs the format_catalog operation.
Sourcepub fn rehearsal(id: Id, event: RehearsalObservationOp<Change>) -> Self
pub fn rehearsal(id: Id, event: RehearsalObservationOp<Change>) -> Self
Constructs the rehearsal operation.
Sourcepub fn transfer(id: Id, event: TransferObservationOp) -> Self
pub fn transfer(id: Id, event: TransferObservationOp) -> Self
Constructs the transfer operation.
Sourcepub fn open_add_sources() -> Self
pub fn open_add_sources() -> Self
Constructs the open_add_sources operation.
Sourcepub fn submit_draft() -> Self
pub fn submit_draft() -> Self
Constructs the submit_draft operation.
Sourcepub fn delete_before_cursor() -> Self
pub fn delete_before_cursor() -> Self
Constructs the delete_before_cursor operation.
Sourcepub fn delete_at_cursor() -> Self
pub fn delete_at_cursor() -> Self
Constructs the delete_at_cursor operation.
Sourcepub fn move_cursor_left() -> Self
pub fn move_cursor_left() -> Self
Constructs the move_cursor_left operation.
Sourcepub fn move_cursor_right() -> Self
pub fn move_cursor_right() -> Self
Constructs the move_cursor_right operation.
Sourcepub fn move_cursor_home() -> Self
pub fn move_cursor_home() -> Self
Constructs the move_cursor_home operation.
Sourcepub fn move_cursor_end() -> Self
pub fn move_cursor_end() -> Self
Constructs the move_cursor_end operation.
Sourcepub fn select_previous() -> Self
pub fn select_previous() -> Self
Constructs the select_previous operation.
Sourcepub fn select_next() -> Self
pub fn select_next() -> Self
Constructs the select_next operation.
Sourcepub fn open_selected() -> Self
pub fn open_selected() -> Self
Constructs the open_selected operation.
Sourcepub fn select_previous_detail() -> Self
pub fn select_previous_detail() -> Self
Constructs the select_previous_detail operation.
Sourcepub fn select_next_detail() -> Self
pub fn select_next_detail() -> Self
Constructs the select_next_detail operation.
Sourcepub fn activate_detail() -> Self
pub fn activate_detail() -> Self
Constructs the activate_detail operation.
Sourcepub fn open_formats() -> Self
pub fn open_formats() -> Self
Constructs the open_formats operation.
Sourcepub fn open_output() -> Self
pub fn open_output() -> Self
Constructs the open_output operation.
Sourcepub fn open_input() -> Self
pub fn open_input() -> Self
Constructs the open_input operation.
Sourcepub fn submit_input() -> Self
pub fn submit_input() -> Self
Constructs the submit_input operation.
Sourcepub fn open_report() -> Self
pub fn open_report() -> Self
Constructs the open_report operation.
Sourcepub fn toggle_dry_run() -> Self
pub fn toggle_dry_run() -> Self
Constructs the toggle_dry_run operation.
Sourcepub fn submit_output() -> Self
pub fn submit_output() -> Self
Constructs the submit_output operation.
Sourcepub fn apply_selected_space() -> Self
pub fn apply_selected_space() -> Self
Constructs the apply_selected_space operation.
Sourcepub fn select_previous_format() -> Self
pub fn select_previous_format() -> Self
Constructs the select_previous_format operation.
Sourcepub fn select_next_format() -> Self
pub fn select_next_format() -> Self
Constructs the select_next_format operation.
Sourcepub fn duplicate_selected() -> Self
pub fn duplicate_selected() -> Self
Constructs the duplicate_selected operation.
Sourcepub fn remove_selected() -> Self
pub fn remove_selected() -> Self
Constructs the remove_selected operation.
Sourcepub fn restart_selected() -> Self
pub fn restart_selected() -> Self
Constructs the restart_selected operation.
Sourcepub fn safe_exit_requested() -> Self
pub fn safe_exit_requested() -> Self
Constructs the safe_exit_requested operation.
Sourcepub fn interpret<Interpreter>(
self,
interpreter: &mut Interpreter,
) -> ManagerIntentReplywhere
Interpreter: ManagerIntentInterpreter<Id = Id, Source = Source, Format = Format, Change = Change>,
pub fn interpret<Interpreter>(
self,
interpreter: &mut Interpreter,
) -> ManagerIntentReplywhere
Interpreter: ManagerIntentInterpreter<Id = Id, Source = Source, Format = Format, Change = Change>,
Interprets this operation with one interpreter and returns its reply.
Trait Implementations§
Source§impl<Id: Clone, Source: Clone, Format: Clone, Change: Clone> Clone for ManagerIntentOp<Id, Source, Format, Change>
impl<Id: Clone, Source: Clone, Format: Clone, Change: Clone> Clone for ManagerIntentOp<Id, Source, Format, Change>
Source§impl<Id: Debug, Source: Debug, Format: Debug, Change: Debug> Debug for ManagerIntentOp<Id, Source, Format, Change>
impl<Id: Debug, Source: Debug, Format: Debug, Change: Debug> Debug for ManagerIntentOp<Id, Source, Format, Change>
impl<Id: Eq, Source: Eq, Format: Eq, Change: Eq> Eq for ManagerIntentOp<Id, Source, Format, Change>
Source§impl<Id: PartialEq, Source: PartialEq, Format: PartialEq, Change: PartialEq> PartialEq for ManagerIntentOp<Id, Source, Format, Change>
impl<Id: PartialEq, Source: PartialEq, Format: PartialEq, Change: PartialEq> PartialEq for ManagerIntentOp<Id, Source, Format, Change>
impl<Id: PartialEq, Source: PartialEq, Format: PartialEq, Change: PartialEq> StructuralPartialEq for ManagerIntentOp<Id, Source, Format, Change>
Auto Trait Implementations§
impl<Id, Source, Format, Change> Freeze for ManagerIntentOp<Id, Source, Format, Change>where
Vec<Source>: Freeze,
Id: Freeze,
FormatDiscoveryOp<Format>: Freeze,
RehearsalObservationOp<Change>: Freeze,
impl<Id, Source, Format, Change> RefUnwindSafe for ManagerIntentOp<Id, Source, Format, Change>where
Vec<Source>: RefUnwindSafe,
Id: RefUnwindSafe,
FormatDiscoveryOp<Format>: RefUnwindSafe,
RehearsalObservationOp<Change>: RefUnwindSafe,
impl<Id, Source, Format, Change> Send for ManagerIntentOp<Id, Source, Format, Change>where
Vec<Source>: Send,
Id: Send,
FormatDiscoveryOp<Format>: Send,
RehearsalObservationOp<Change>: Send,
impl<Id, Source, Format, Change> Sync for ManagerIntentOp<Id, Source, Format, Change>where
Vec<Source>: Sync,
Id: Sync,
FormatDiscoveryOp<Format>: Sync,
RehearsalObservationOp<Change>: Sync,
impl<Id, Source, Format, Change> Unpin for ManagerIntentOp<Id, Source, Format, Change>where
Vec<Source>: Unpin,
Id: Unpin,
FormatDiscoveryOp<Format>: Unpin,
RehearsalObservationOp<Change>: Unpin,
impl<Id, Source, Format, Change> UnsafeUnpin for ManagerIntentOp<Id, Source, Format, Change>where
Vec<Source>: UnsafeUnpin,
Id: UnsafeUnpin,
FormatDiscoveryOp<Format>: UnsafeUnpin,
RehearsalObservationOp<Change>: UnsafeUnpin,
impl<Id, Source, Format, Change> UnwindSafe for ManagerIntentOp<Id, Source, Format, Change>where
Vec<Source>: UnwindSafe,
Id: UnwindSafe,
FormatDiscoveryOp<Format>: UnwindSafe,
RehearsalObservationOp<Change>: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<This> IntoExt<This> for This
impl<This> IntoExt<This> for This
Source§fn to<R>(self) -> Rwhere
This: Into<R>,
fn to<R>(self) -> Rwhere
This: Into<R>,
A version of Into::into function that can be used to explicitly specify the target
conversion type.
use alux_sdk::*;
// `Into` requires context to infer the type,
let _: i64 = Into::into(42_i8);
// The opposite `From` requires context to infer the type,
let _: i64 = From::from(42_i8);
// `.to()` can be used in the same way as a postfix function (the same as `.into()`),
let _: i64 = 42_i8.to();
// but also with the type specified explicitly.
let _ = 42_i8.to::<i64>();
// Especially useful to chain multiple conversions inline.
let _: i64 = 42_i8.to::<i16>().to::<i32>().into();Source§impl<This> IntoIteratorExt<This> for This
impl<This> IntoIteratorExt<This> for This
Source§fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
A variant of the try_collect and collect_vec combined function from the Itertools
library. The materialized value is a Vec inside a Result object.
Returns the first error without collecting later values.
use alux_sdk::*;
let values = [Ok::<_, &str>(1), Ok(2), Ok(3)]
.into_iter()
.try_collect_vec();
assert_eq!(values, Ok(vec![1, 2, 3]));Source§fn collect_exact<T>(self, n: usize) -> Option<Vec<T>>where
This: Iterator<Item = T>,
fn collect_exact<T>(self, n: usize) -> Option<Vec<T>>where
This: Iterator<Item = T>,
Takes exactly n elements from the iterator.
Returns Some(Vec<T>) if the iterator yields exactly n elements,
otherwise returns None.
use alux_sdk::*;
let v = [1, 2, 3];
assert_eq!(v.iter().copied().collect_exact(3), Some(vec![1, 2, 3]));
assert_eq!(v.iter().copied().collect_exact(4), None);
assert_eq!(v.iter().copied().collect_exact(2), None);Source§fn try_unzip<A, B, E>(self) -> Result<(Vec<A>, Vec<B>), E>
fn try_unzip<A, B, E>(self) -> Result<(Vec<A>, Vec<B>), E>
Efficiently splits an iterator of Result<(A, B), E> into two Vecs, short-circuiting on error.
Consumes the iterator, collecting all A elements into one vector and all B elements into another,
without first allocating an intermediate vector of tuples. Returns the tuple (Vec<A>, Vec<B>) on success,
or the first error encountered.
use alux_sdk::*;
let input = vec![Ok((1, "x")), Ok((2, "y"))];
let (xs, ys) = input.try_unzip::<_, _, ()>().unwrap();
assert_eq!(xs, vec![1, 2]);
assert_eq!(ys, vec!["x", "y"]);