pub struct Def<CTX: Context> { /* private fields */ }
Expand description

Process definition.

Implementations

The only method to create a valid process def struct. Checks for duplicate sourcepoints or endpoints, self-loops, and restrictions on process kind (asynchronous processes are incompatible with certain combinations of backends).

Errors

Duplicate sourcepoint:

let result = process::Def::<Mycontext>::define (
  ProcessId::A,
  process::Kind::isochronous_default(),
  vec![ChannelId::X, ChannelId::Z, ChannelId::X],
  vec![ChannelId::Y]);
assert_eq!(
  result, Err (vec![process::DefineError::DuplicateSourcepoint]));

Duplicate endpoint:

let result = process::Def::<Mycontext>::define (
  ProcessId::A,
  process::Kind::isochronous_default(),
  vec![ChannelId::X, ChannelId::Z],
  vec![ChannelId::Y, ChannelId::Y]);
assert_eq!(
  result, Err (vec![process::DefineError::DuplicateEndpoint]));

Self-loop:

let result = process::Def::<Mycontext>::define (
  ProcessId::A,
  process::Kind::isochronous_default(),
  vec![ChannelId::X, ChannelId::Z],
  vec![ChannelId::Y, ChannelId::Z]);
assert_eq!(
  result, Err (vec![process::DefineError::SourcepointEqEndpoint]));

Asynchronous process zero endpoints:

let result = process::Def::<Mycontext>::define (
  ProcessId::A,
  process::Kind::asynchronous_default(),
  vec![ChannelId::Z],
  vec![]);
assert_eq!(
  result,
  Err (vec![process::DefineError::AsynchronousZeroEndpoints]));

Asynchronous process multiple endpoints:

let result = process::Def::<Mycontext>::define (
  ProcessId::A,
  process::Kind::asynchronous_default(),
  vec![ChannelId::Z],
  vec![ChannelId::X, ChannelId::Y]);
assert_eq!(
  result,
  Err (vec![process::DefineError::AsynchronousMultipleEndpoints]));

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.