Socket
Book a DemoInstallSign in
Socket

aabel-identifier-rs

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aabel-identifier-rs

0.1.2
Source
Cargo
Version published
Maintainers
1
Created
Source

Simplee > Aabel > Identifier

Crates.io CI GitHub top language License:MIT GitHub code size in bytes GitHub last commit GitHub watchers

Description

A Rust crate that defines some behavior related to identifiers, such:

  • any type which implements Eq will be an Identifier.
  • any type which implements PartialOrd will be a PartialOrdIdentifier.
  • capabilities to generate sequences of identifiers.

Examples

Any type which implements the [Eq] trait will automatically be an identifier.

use aabel_identifier_rs::*;

fn test_identifier(_id: impl Identifier) {
    assert!(true);
}

let id = 10_u8;
test_identifier(id);

You can create an iterator which generates new idenfiers, given a starting point and a function which compute a new identifier value from a previous one.

use aabel_identifier_rs::*;

let id = 10_u8;
let mut iter = id.into_ids_iterator(|id| id + 1);

assert_eq!(iter.next(), Some(10));
assert_eq!(iter.next(), Some(11));

About

Code designed and written on the beautiful island of Saaremaa, Estonia.

FAQs

Package last updated on 22 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.