Reference · Object · library.rs
Library Object
Workflows and history, saved as one JSON file in folder.
class Library {
static func open(folder: String) -> Library
func reload()
func workflows() -> [Workflow]
func workflow(id: String) -> Workflow?
func mayAddWorkflow(isPro: Bool) -> Bool
func saveWorkflow(w: Workflow)
func deleteWorkflow(id: String)
func history() -> [HistoryEntry]
func record(e: HistoryEntry)
func removeEntry(id: String)
func clearHistory()
}public class Library {
public static Library Open(string folder)
public void Reload()
public Workflow[] Workflows()
public Workflow? Workflow(string id)
public bool MayAddWorkflow(bool isPro)
public void SaveWorkflow(Workflow w)
public void DeleteWorkflow(string id)
public HistoryEntry[] History()
public void Record(HistoryEntry e)
public void RemoveEntry(string id)
public void ClearHistory()
}impl Library {
pub fn open(folder: String) -> Arc<Library>
pub fn reload(&self)
pub fn workflows(&self) -> Vec<Workflow>
pub fn workflow(&self, id: String) -> Option<Workflow>
pub fn may_add_workflow(&self, is_pro: bool) -> bool
pub fn save_workflow(&self, w: Workflow)
pub fn delete_workflow(&self, id: String)
pub fn history(&self) -> Vec<HistoryEntry>
pub fn record(&self, e: HistoryEntry)
pub fn remove_entry(&self, id: String)
pub fn clear_history(&self)
}Methods
open Constructor
No description yet.
static func open(folder: String) -> Librarypublic static Library Open(string folder)pub fn open(folder: String) -> Arc<Library>Parameters
| Name | Type | Swift / C# |
|---|---|---|
folder | String | folder |
Returns
Errors
Does not throw.
reload
Reads the file again: another process (the app's share extension) may have written to it. A file that does not read completely changes nothing.
func reload()public void Reload()pub fn reload(&self)Parameters
None.
Returns
Nothing.
Errors
Does not throw.
workflows
No description yet.
func workflows() -> [Workflow]public Workflow[] Workflows()pub fn workflows(&self) -> Vec<Workflow>Parameters
None.
Returns
Vec<Workflow>
Errors
Does not throw.
workflow
No description yet.
func workflow(id: String) -> Workflow?public Workflow? Workflow(string id)pub fn workflow(&self, id: String) -> Option<Workflow>Parameters
| Name | Type | Swift / C# |
|---|---|---|
id | String | id |
Returns
Option<Workflow>
Errors
Does not throw.
may_add_workflow
A new workflow may be made (the first is free).
func mayAddWorkflow(isPro: Bool) -> Boolpublic bool MayAddWorkflow(bool isPro)pub fn may_add_workflow(&self, is_pro: bool) -> boolParameters
| Name | Type | Swift / C# |
|---|---|---|
is_pro | bool | isPro |
Returns
bool
Errors
Does not throw.
save_workflow
No description yet.
func saveWorkflow(w: Workflow)public void SaveWorkflow(Workflow w)pub fn save_workflow(&self, w: Workflow)Parameters
| Name | Type | Swift / C# |
|---|---|---|
w | Workflow | w |
Returns
Nothing.
Errors
Does not throw.
delete_workflow
No description yet.
func deleteWorkflow(id: String)public void DeleteWorkflow(string id)pub fn delete_workflow(&self, id: String)Parameters
| Name | Type | Swift / C# |
|---|---|---|
id | String | id |
Returns
Nothing.
Errors
Does not throw.
history
No description yet.
func history() -> [HistoryEntry]public HistoryEntry[] History()pub fn history(&self) -> Vec<HistoryEntry>Parameters
None.
Returns
Vec<HistoryEntry>
Errors
Does not throw.
record
No description yet.
func record(e: HistoryEntry)public void Record(HistoryEntry e)pub fn record(&self, e: HistoryEntry)Parameters
| Name | Type | Swift / C# |
|---|---|---|
e | HistoryEntry | e |
Returns
Nothing.
Errors
Does not throw.
remove_entry
No description yet.
func removeEntry(id: String)public void RemoveEntry(string id)pub fn remove_entry(&self, id: String)Parameters
| Name | Type | Swift / C# |
|---|---|---|
id | String | id |
Returns
Nothing.
Errors
Does not throw.
clear_history
No description yet.
func clearHistory()public void ClearHistory()pub fn clear_history(&self)Parameters
None.
Returns
Nothing.
Errors
Does not throw.
Signatures are generated from the engine’s code. Swift is checked against the generated bindings; C# follows the bindings generator’s naming rules.