Skip to content

Commit

Permalink
#108 Alert up
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 19, 2023
1 parent 610da9e commit 8e56737
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
8 changes: 1 addition & 7 deletions src/alerts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,10 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

use crate::Sodg;
use crate::{Alert, Sodg};
use anyhow::anyhow;
use anyhow::Result;

/// A function that is called when a problem is found in [`Sodg`].
///
/// Instances of this type can be used in [`Sodg::alert_on`] method,
/// in order to ensure runtime consistency of data inside the graph.
pub type Alert = fn(g: &Sodg, vx: Vec<u32>) -> Vec<String>;

impl Sodg {
/// Attach a new alert to this graph.
///
Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ mod xml;

use anyhow::Result;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::collections::{HashMap, HashSet};

pub use crate::alerts::Alert;
use std::collections::HashSet;
/// A function that is called when a problem is found in [`Sodg`].
///
/// Instances of this type can be used in [`Sodg::alert_on`] method,
/// in order to ensure runtime consistency of data inside the graph.
pub type Alert = fn(g: &Sodg, vx: Vec<u32>) -> Vec<String>;

/// An object-oriented representation of binary data
/// in hexadecimal format, which can be put into vertices of the graph.
Expand Down

0 comments on commit 8e56737

Please sign in to comment.