Struct Process

Source
pub struct Process {
Show 16 fields number: String, all_revisions: Vec<(String, String)>, title: String, process_type: String, author: String, reviewer: String, subject: String, subject_image: String, product: String, product_image: String, all_objectives: Vec<(String, String)>, all_out_of_scopes: Vec<(String, String)>, all_sections: Vec<Section>, all_resources: Vec<(Resource, String)>, all_verifications: Vec<(Requirement, String)>, all_templates: Vec<String>,
}
Expand description

Top-level struct containing all information read from the markup file

All fields are private, but are accessible with “get” functions, e.g. Process.get_number() returns a reference to the Process’s number (&String).

Fields§

§number: String

Document Number, in whatever format makes sense for the organization’s document control system

§all_revisions: Vec<(String, String)>

A stack of Revision lines, with an important assumption that the first Revision line represents the current Rev of the document, and the last Revision line represents the first released Rev of the document

  • First String: “Rev” text, e.g. “A” for a document’s Revision A
  • Second String: “What changed?” text, e.g. “New section added to initialize the system prior to start”
§title: String

Human-readable Title of the process document, hopefully with enough meaning for the team to understand the purpose of the process

§process_type: String

Human-readable category of process document, such as “Test Procedure” or “Work Instruction” or “Maintenance Procedure” etc.

§author: String

Human that composed the markup file in its current Revision, i.e. who currently owns the knowledge in this process

§reviewer: String

Human responsible for being the second set of eyes for this Revision, and who is the gatekeeper to publishing this Revision prior to its use in the field

§subject: String

The thing that this process applies to, i.e. the primary input into the Process, be it tangible or abstract

§subject_image: String

File name for an image of the Subject

§product: String

If this process changes the Subject into something else, then that something else is the Product

§product_image: String

File name for an image of the Product

§all_objectives: Vec<(String, String)>

Compiled list of Objective statements found throughout the document when they are achieved

§all_out_of_scopes: Vec<(String, String)>

Compiled list of Out-of-Scope statements found throughout the document when they are achieved

§all_sections: Vec<Section>

Ordered set of all Step-filled sections of the document

§all_resources: Vec<(Resource, String)>

Cummulative list of all Resources identified in all Steps

§all_verifications: Vec<(Requirement, String)>

Cummulative list of all Verifications of Requirements performed in all Steps

§all_templates: Vec<String>

File names for custom templates (CSS) to use that augment the vanilla template

  • Company-specific
  • Project-specific
  • Security environment-specific
  • etc.

Implementations§

Source§

impl Process

Functions necessary to create ::new() structs, as well as “get” every private field publicly, and to change or append private fields publicly

Source

pub fn new() -> Process

Return Process struct with placeholder text in String fields, and empty vectors for Vec fields

Source

pub fn get_number(&self) -> &String

Return reference to the Document Number string

Source

pub fn get_revision(&self) -> &String

Return reference to the LATEST Revision (first listed in the markup file)

Source

pub fn get_all_revisions(&self) -> &Vec<(String, String)>

Return reference to the vector of touples describing each Revision and what changed

Source

pub fn get_title(&self) -> &String

Return reference to the Title string

Source

pub fn get_process_type(&self) -> &String

Return reference to the Process Type string

Source

pub fn get_author(&self) -> &String

Return reference to the Author string

Source

pub fn get_reviewer(&self) -> &String

Return reference to the Reviewer string

Source

pub fn get_subject(&self) -> &String

Return reference to the Subject string

Source

pub fn get_subject_image(&self) -> &String

Return reference to the file name of an Image of the Subject as string

Source

pub fn get_product(&self) -> &String

Return reference to the Product string

Source

pub fn get_product_image(&self) -> &String

Return reference to the file name of an Image of the Product as string

Source

pub fn get_all_sections(&self) -> &Vec<Section>

Return reference to a Vector of Sections, in the order they appear in the markup

Source

pub fn get_all_verifications(&self) -> &Vec<(Requirement, String)>

Return reference to a Vector of Requirement Tuples, each with a Requirement struct and a string containing the Step number

Source

pub fn get_all_objectives(&self) -> &Vec<(String, String)>

Return reference to a Vector of Tuples describing each objective and at what step it is achieved

Source

pub fn get_all_out_of_scopes(&self) -> &Vec<(String, String)>

Return reference to a Vector of Tuples describing each out-of-scope declaration and at from which step

Source

pub fn get_all_templates(&self) -> &Vec<String>

Return reference to a Vector of Templates as strings, one for each CSS file needed for the process

Source

pub fn get_all_resources(&self) -> &Vec<(Resource, String)>

Return reference to a Vector of Resource Tuples, each with a Resource struct and a string containing the Step number

Source

pub fn get_tpv_count(&self) -> usize

Return the total number of Action lines that require Two-Party Verification (TPV)

Source

pub fn get_non_tpv_count(&self) -> usize

Return the total number of Action lines that don’t require Two-Party Verification (no TPV)

Source

pub fn get_all_command_lines(&self) -> Vec<(String, String)>

Return a vector of string tuples, with every “Command” line’s text (first element), with the step number (second element) in order of appearance in the process

Source

pub fn display_process_to_stdout(&self)

Used in verbose mode to display contents of the struct to stdout

Source

pub fn set_number(&mut self, doc_num: &str)

Change the Document Number

Source

pub fn add_revision(&mut self, rev_line: &str)

Add a Revision Tuple to the Vector “all_revisions”

Source

pub fn set_title(&mut self, title: &str)

Change the Document Title

Source

pub fn set_process_type(&mut self, process_type: &str)

Change the Process Type

Source

pub fn set_author(&mut self, author: &str)

Change the Document Author

Source

pub fn set_reviewer(&mut self, reviewer: &str)

Change the Document Reviewer

Source

pub fn set_subject(&mut self, subject: &str)

Change the Document Subject

Source

pub fn set_subject_image(&mut self, subject_image: &str)

Change the Image file name of the Document Subject

Source

pub fn set_product(&mut self, product: &str)

Change the Document Product

Source

pub fn set_product_image(&mut self, product_image: &str)

Change the Image file name of the Document Product

Source

pub fn add_template(&mut self, template: &str)

Add a Template file to the Vector of Template files (strings)

Source

pub fn add_section(&mut self, section: Section)

Add a Section to the Vector of Section structs

Source

pub fn add_verification(&mut self, requirement: Requirement, step: String)

Add a Verification tuple to the Vector of Verification tuples

Source

pub fn add_objective(&mut self, objective: String, step: String)

Add an Objective tuple to the Vector of Objective tuples

Source

pub fn add_out_of_scope(&mut self, out_of_scope: String, step: String)

Add an Out-of-Scope tuple to the Vector of Out-of-Scope tuples

Source

pub fn add_resource(&mut self, resource: Resource, step: String)

Add a Resource struct to the Vector of Resource structs

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, 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.