repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols-sys/src/client_cg.rs
rust/protocols-sys/src/client_cg.rs
use crate::*; use algebra::{fixed_point::*, fp_64::Fp64Parameters, FpParameters, PrimeField}; use crypto_primitives::additive_share::AdditiveShare; use neural_network::{ layers::{convolution::Padding, LinearLayerInfo}, tensors::{Input, Output}, }; use std::os::raw::c_char; pub struct Conv2D<'a> { data: Met...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols-sys/src/client_gen.rs
rust/protocols-sys/src/client_gen.rs
use crate::*; use std::os::raw::c_char; pub trait ClientGen { type Keys; /// The type of messages passed between client and server type MsgType; /// Create new ClientGen object fn new(keys: Self::Keys) -> Self; /// Preprocess `a` and `b` randomizers for sending to the server fn triples_pr...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols-sys/tests/interface_test.rs
rust/protocols-sys/tests/interface_test.rs
use algebra::{ fields::{near_mersenne_64::F, PrimeField}, fixed_point::{FixedPoint, FixedPointParameters}, UniformRandom, }; use crypto_primitives::{additive_share::Share, beavers_mul::Triple}; use itertools::izip; use ndarray::s; use neural_network::{layers::*, tensors::*, Evaluate}; use protocols_sys::*; ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols/src/beavers_mul.rs
rust/protocols/src/beavers_mul.rs
#![allow(dead_code)] use crate::{AdditiveShare, InMessage, OutMessage}; use algebra::{ fields::PrimeField, fixed_point::{FixedPoint, FixedPointParameters}, fp_64::Fp64Parameters, FpParameters, UniformRandom, }; use crypto_primitives::{BeaversMul, BlindedSharedInputs}; use io_utils::imux::IMuxSync; use p...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols/src/bytes.rs
rust/protocols/src/bytes.rs
use io_utils::imux::IMuxSync; #[inline] pub fn serialize<W: std::io::Write + Send, T: ?Sized>( writer: &mut IMuxSync<W>, value: &T, ) -> Result<(), bincode::Error> where T: serde::Serialize, { let bytes: Vec<u8> = bincode::serialize(value)?; let _ = writer.write(&bytes)?; writer.flush()?; O...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols/src/linear_layer.rs
rust/protocols/src/linear_layer.rs
use crate::{AdditiveShare, InMessage, OutMessage}; use algebra::{ fixed_point::{FixedPoint, FixedPointParameters}, fp_64::Fp64Parameters, FpParameters, PrimeField, UniformRandom, }; use crypto_primitives::additive_share::Share; use io_utils::imux::IMuxSync; use neural_network::{ layers::*, tensors::...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols/src/lib.rs
rust/protocols/src/lib.rs
use algebra::fixed_point::FixedPoint; use io_utils::imux::IMuxSync; use protocols_sys::{ClientFHE, KeyShare, ServerFHE}; use serde::{Deserialize, Serialize}; use std::{ io::{Read, Write}, marker::PhantomData, }; #[macro_use] extern crate bench_utils; extern crate ndarray; pub mod beavers_mul; pub mod gc; pub...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols/src/gc.rs
rust/protocols/src/gc.rs
use crate::{AdditiveShare, InMessage, OutMessage}; use algebra::{ fields::PrimeField, fixed_point::{FixedPoint, FixedPointParameters}, fp_64::Fp64Parameters, BigInteger64, FpParameters, UniformRandom, }; use crypto_primitives::{ gc::{ fancy_garbling, fancy_garbling::{ cir...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols/src/quad_approx.rs
rust/protocols/src/quad_approx.rs
use crate::{beavers_mul::BeaversMulProtocol, AdditiveShare}; use algebra::{ fields::PrimeField, fixed_point::{FixedPoint, FixedPointParameters}, fp_64::Fp64Parameters, FpParameters, Polynomial, }; use crypto_primitives::{BeaversMul, Triple}; use io_utils::imux::IMuxSync; use protocols_sys::*; use rand::...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols/src/tests.rs
rust/protocols/src/tests.rs
use crate::AdditiveShare; use algebra::{ fields::near_mersenne_64::F, fixed_point::{FixedPoint, FixedPointParameters}, }; use crypto_primitives::{additive_share::Share, beavers_mul::FPBeaversMul}; use io_utils::imux::IMuxSync; use protocols_sys::*; use rand::{Rng, SeedableRng}; use rand_chacha::ChaChaRng; use s...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/protocols/src/neural_network.rs
rust/protocols/src/neural_network.rs
use crate::AdditiveShare; use bench_utils::{timer_end, timer_start}; use neural_network::{ layers::{Layer, LayerInfo, NonLinearLayer, NonLinearLayerInfo}, NeuralArchitecture, NeuralNetwork, }; use rand::{CryptoRng, RngCore}; use std::{ io::{Read, Write}, marker::PhantomData, }; use algebra::{ fixed...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/bytes.rs
rust/algebra/src/bytes.rs
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use std::io::{Read, Result as IoResult, Write}; pub trait ToBytes { /// Serializes `self` into `writer`. fn write<W: Write>(&self, writer: W) -> IoResult<()>; } pub trait FromBytes: Sized { /// Reads `Self` from `reader`. fn read<R: Read>(rea...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/lib.rs
rust/algebra/src/lib.rs
#![deny( unused_import_braces, unused_qualifications, trivial_casts, trivial_numeric_casts )] #![deny(unused_qualifications, variant_size_differences, stable_features)] #![deny( non_shorthand_field_patterns, unused_attributes, unused_imports, unused_extern_crates )] #![deny( renamed_...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fixed_point.rs
rust/algebra/src/fixed_point.rs
use derivative::Derivative; use num_traits::{One, Zero}; use serde::{Deserialize, Serialize}; use std::{ fmt::{Display, Formatter, Result as FmtResult}, marker::PhantomData, ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}, }; use crate::{ biginteger::BigInteger, fields::{Field, FpParamet...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/polynomial.rs
rust/algebra/src/polynomial.rs
use num_traits::{One, Zero}; use std::ops::{AddAssign, Mul, MulAssign}; /// A polynomial with coefficients in `F`. #[derive(Debug, Clone)] pub struct Polynomial<F> { coeffs: Vec<F>, } impl<C> Polynomial<C> { /// Constructs a new polynomial p(x) = a_0 + a_1 * x + ... + a_n x^n /// when given as inputs the ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/utils.rs
rust/algebra/src/utils.rs
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/biginteger/bigint_32.rs
rust/algebra/src/biginteger/bigint_32.rs
use crate::{ biginteger::BigInteger, bytes::{FromBytes, ToBytes}, fields::BitIterator, }; use rand::{CryptoRng, Rng, RngCore}; use serde::{Deserialize, Serialize}; use std::{ fmt::Display, io::{Read, Result as IoResult, Write}, }; #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Hash, Serialize...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/biginteger/tests.rs
rust/algebra/src/biginteger/tests.rs
use crate::biginteger::BigInteger; use rand::{self, CryptoRng, RngCore, SeedableRng}; use rand_chacha::ChaChaRng; const RANDOMNESS: [u8; 32] = [ 0x99, 0xe0, 0x8f, 0xbc, 0x89, 0xa7, 0x34, 0x01, 0x45, 0x86, 0x82, 0xb6, 0x51, 0xda, 0xf4, 0x76, 0x5d, 0xc9, 0x8d, 0x62, 0x23, 0xf2, 0x90, 0x8f, 0x9d, 0x03, 0xf2, 0x77...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/biginteger/bigint_64.rs
rust/algebra/src/biginteger/bigint_64.rs
use crate::{ biginteger::BigInteger, bytes::{FromBytes, ToBytes}, fields::BitIterator, }; use rand::{CryptoRng, Rng, RngCore}; use serde::{Deserialize, Serialize}; use std::{ fmt::Display, io::{Read, Result as IoResult, Write}, }; #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Hash, Serialize...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/biginteger/macros.rs
rust/algebra/src/biginteger/macros.rs
macro_rules! bigint_impl { ($name:ident, $num_limbs:expr, $iter_name:ident) => { #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Hash, Serialize, Deserialize)] pub struct $name(pub [u64; $num_limbs]); impl $name { pub fn new(value: [u64; $num_limbs]) -> Self { ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/biginteger/mod.rs
rust/algebra/src/biginteger/mod.rs
use crate::{ bytes::{FromBytes, ToBytes}, fields::BitIterator, }; use rand::{CryptoRng, Rng, RngCore}; use serde::{Deserialize, Serialize}; use std::{ fmt::{Debug, Display}, io::{Read, Result as IoResult, Write}, iter::FromIterator, }; #[macro_use] mod macros; mod bigint_32; pub use bigint_32::*; ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/tests.rs
rust/algebra/src/fields/tests.rs
use crate::fields::{Field, LegendreSymbol, PrimeField, SquareRootField}; use rand::{CryptoRng, Rng, RngCore, SeedableRng}; use rand_chacha::ChaChaRng; pub const ITERATIONS: u32 = 40; const RANDOMNESS: [u8; 32] = [ 0x99, 0xe0, 0x8f, 0xbc, 0x89, 0xa7, 0x34, 0x01, 0x45, 0x86, 0x82, 0xb6, 0x51, 0xda, 0xf4, 0x76, 0...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/macros.rs
rust/algebra/src/fields/macros.rs
macro_rules! impl_field_into_bigint { ($field: ident, $bigint: ident, $params: ident) => { impl<P: $params> From<$field<P>> for $bigint { fn from(val: $field<P>) -> Self { val.into_repr() } } }; } macro_rules! impl_ops_traits { ($field: ident, $params...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/mod.rs
rust/algebra/src/fields/mod.rs
use crate::{ biginteger::BigInteger, bytes::{FromBytes, ToBytes}, UniformRandom, }; use num_traits::{One, Zero}; use serde::{Deserialize, Serialize}; use std::{ fmt::{Debug, Display}, hash::Hash, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, str::FromStr, }; #[...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/models/fp_384.rs
rust/algebra/src/fields/models/fp_384.rs
use num_traits::{One, Zero}; use rand::{CryptoRng, RngCore}; use std::{ cmp::{Ord, Ordering, PartialOrd}, fmt::{Display, Formatter, Result as FmtResult}, io::{Read, Result as IoResult, Write}, marker::PhantomData, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, str::F...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/models/fp_32.rs
rust/algebra/src/fields/models/fp_32.rs
use num_traits::{One, Zero}; use rand::{CryptoRng, RngCore}; use std::{ cmp::{Ord, Ordering, PartialOrd}, fmt::{Display, Formatter, Result as FmtResult}, io::{Read, Result as IoResult, Write}, marker::PhantomData, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, str::F...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/models/fp_32_lazy.rs
rust/algebra/src/fields/models/fp_32_lazy.rs
use num_traits::{One, Zero}; use rand::{CryptoRng, RngCore}; use std::{ cmp::{Ord, Ordering, PartialOrd}, fmt::{Display, Formatter, Result as FmtResult}, io::{Read, Result as IoResult, Write}, marker::PhantomData, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, str::F...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/models/fp_256.rs
rust/algebra/src/fields/models/fp_256.rs
use num_traits::{One, Zero}; use rand::{CryptoRng, RngCore}; use std::{ cmp::{Ord, Ordering, PartialOrd}, fmt::{Display, Formatter, Result as FmtResult}, io::{Read, Result as IoResult, Write}, marker::PhantomData, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, str::F...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/models/fp_64.rs
rust/algebra/src/fields/models/fp_64.rs
use num_traits::{One, Zero}; use rand::{CryptoRng, RngCore}; use std::{ cmp::{Ord, Ordering, PartialOrd}, fmt::{Display, Formatter, Result as FmtResult}, io::{Read, Result as IoResult, Write}, marker::PhantomData, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}, str::F...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/models/mod.rs
rust/algebra/src/fields/models/mod.rs
pub mod fp_32_lazy; pub mod fp_32; pub use self::fp_32::*; pub mod fp_64; pub use self::fp_64::*; pub mod fp_256; pub use self::fp_256::*; pub mod fp_384; pub use self::fp_384::*;
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/near_mersenne_64/tests.rs
rust/algebra/src/fields/near_mersenne_64/tests.rs
#[cfg(test)] mod tests { use crate::fields::{ tests::{field_test, primefield_test}, UniformRandom, }; use rand::SeedableRng; use rand_chacha::ChaChaRng; const RANDOMNESS: [u8; 32] = [ 0x99, 0xe0, 0x8f, 0xbc, 0x89, 0xa7, 0x34, 0x01, 0x45, 0x86, 0x82, 0xb6, 0x51, 0xda, 0xf4, ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/algebra/src/fields/near_mersenne_64/mod.rs
rust/algebra/src/fields/near_mersenne_64/mod.rs
use crate::{ biginteger::BigInteger64 as BigInteger, fields::{Fp64, Fp64Parameters, FpParameters}, }; pub type F = Fp64<FParameters>; pub struct FParameters; impl Fp64Parameters for FParameters {} impl FpParameters for FParameters { type BigInt = BigInteger; const MODULUS: BigInteger = BigInteger(20...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/bench-utils/src/lib.rs
rust/bench-utils/src/lib.rs
#[cfg(feature = "timer")] extern crate colored; pub use self::inner::*; #[cfg(feature = "timer")] #[macro_use] pub mod inner { pub use colored::Colorize; // print-trace requires std, so these imports are well-defined pub use std::{ format, println, string::{String, ToString}, sync...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/lib.rs
rust/neural-network/src/lib.rs
#![allow(incomplete_features)] #![feature(specialization)] use crate::tensors::{Input, Output}; use ndarray::ArrayView; use num_traits::{One, Zero}; use std::{ io::Read, ops::{AddAssign, Mul, MulAssign}, }; #[macro_use] pub extern crate ndarray; pub extern crate npy; extern crate npy_derive; pub mod layers; ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/layers/non_linear.rs
rust/neural-network/src/layers/non_linear.rs
use crate::{ layers::LayerDims, tensors::{Input, Output}, }; use algebra::Polynomial; use num_traits::{One, Zero}; use std::{ marker::PhantomData, ops::{AddAssign, Mul, MulAssign}, }; use crate::Evaluate; use NonLinearLayer::*; #[derive(Debug, Clone)] pub enum NonLinearLayer<F, C = F> { ReLU(Layer...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/layers/mod.rs
rust/neural-network/src/layers/mod.rs
use crate::{ tensors::{Input, Output}, Evaluate, }; use num_traits::{One, Zero}; use std::ops::{AddAssign, Mul, MulAssign}; mod linear; mod non_linear; pub use linear::*; pub use non_linear::*; use Layer::*; #[derive(Copy, Clone, Debug, Eq, PartialEq)] pub struct LayerDims { /// Dimension of the input to...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/layers/linear/tests.rs
rust/neural-network/src/layers/linear/tests.rs
use super::*; use crate::*; use algebra::fields::near_mersenne_64::F; use rand::Rng; use rand_chacha::ChaChaRng; struct TenBitExpParams {} impl FixedPointParameters for TenBitExpParams { type Field = F; const MANTISSA_CAPACITY: u8 = 3; const EXPONENT_CAPACITY: u8 = 5; } type TenBitExpFP = FixedPoint<TenBi...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/layers/linear/fully_connected.rs
rust/neural-network/src/layers/linear/fully_connected.rs
use crate::tensors::{Input, Kernel, Output}; use algebra::{fp_64::Fp64Parameters, FixedPoint, FixedPointParameters, FpParameters, PrimeField}; use crypto_primitives::AdditiveShare; use num_traits::Zero; use std::{ marker::PhantomData, ops::{Add, AddAssign, Mul}, }; use tch::nn; #[derive(Debug)] pub struct Full...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/layers/linear/mod.rs
rust/neural-network/src/layers/linear/mod.rs
use crate::{ tensors::{Input, Kernel, Output}, EvalMethod, Evaluate, }; use algebra::{fixed_point::*, fp_64::Fp64Parameters, FpParameters, PrimeField}; use crypto_primitives::AdditiveShare; use num_traits::{One, Zero}; use std::{ marker::PhantomData, ops::{AddAssign, Mul}, }; use tch::nn::Module; use c...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/layers/linear/average_pooling.rs
rust/neural-network/src/layers/linear/average_pooling.rs
use crate::tensors::{Input, Output}; use num_traits::Zero; use std::{ marker::PhantomData, ops::{AddAssign, Mul}, }; #[derive(Debug, Clone)] pub struct AvgPoolParams<F, C> { pub pool_h: usize, pub pool_w: usize, pub stride: usize, pub normalizer: C, _variable: PhantomData<F>, } impl<F, C> ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/layers/linear/convolution.rs
rust/neural-network/src/layers/linear/convolution.rs
use crate::tensors::{Input, Kernel, Output}; use algebra::{fp_64::Fp64Parameters, FixedPoint, FixedPointParameters, FpParameters, PrimeField}; use num_traits::Zero; use std::{ marker::PhantomData, ops::{AddAssign, Mul}, }; use tch::nn; #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum Padding { Same, ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/tensors/macros.rs
rust/neural-network/src/tensors/macros.rs
macro_rules! ndarray_impl { ($name:ident, $inner:ident, $dims:ty) => { #[derive(Clone, PartialEq, Eq, Debug, Default, Hash, Serialize, Deserialize)] pub struct $name<F>($inner<F>); impl<F> $name<F> { #[inline] pub fn from_elem(dim: $dims, elem: F) -> Self ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/src/tensors/mod.rs
rust/neural-network/src/tensors/mod.rs
use algebra::{fp_64::Fp64Parameters, FixedPoint, FixedPointParameters, FpParameters, PrimeField}; use crypto_primitives::{AdditiveShare, Share}; use ndarray::Array4; use num_traits::Zero; use rand::{CryptoRng, RngCore}; use serde::{Deserialize, Serialize}; use tch::Tensor; #[macro_use] mod macros; type Quadruple = (u...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/benches/torch.rs
rust/neural-network/benches/torch.rs
#![feature(test)] extern crate test; use algebra::{fields::near_mersenne_64::F, *}; use neural_network::{ layers::{convolution::*, *}, tensors::*, }; use rand::Rng; use rand_chacha::ChaChaRng; use test::Bencher; struct TenBitExpParams {} impl FixedPointParameters for TenBitExpParams { type Field = F; c...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/benches/fully_connected.rs
rust/neural-network/benches/fully_connected.rs
use criterion::{criterion_group, criterion_main, Criterion}; use std::time::Duration; use algebra::{fields::near_mersenne_64::F, fixed_point::*}; use neural_network::{layers::fully_connected::*, tensors::*}; use rand::{Rng, SeedableRng}; use rand_chacha::ChaChaRng; fn generate_random_number<R: Rng>(rng: &mut R) -> (f...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/benches/average_pooling.rs
rust/neural-network/benches/average_pooling.rs
use criterion::{criterion_group, criterion_main, Criterion}; use std::time::Duration; use algebra::{fields::near_mersenne_64::F, fixed_point::*}; use neural_network::{layers::average_pooling::*, tensors::*}; use rand::{Rng, SeedableRng}; use rand_chacha::ChaChaRng; fn generate_random_number<R: Rng>(rng: &mut R) -> (f...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
mc2-project/delphi
https://github.com/mc2-project/delphi/blob/92bc0071fa11570df6b048ae0f6937ced249bb5a/rust/neural-network/benches/convolution.rs
rust/neural-network/benches/convolution.rs
use criterion::{criterion_group, criterion_main, Criterion}; use std::time::Duration; use algebra::{fields::near_mersenne_64::F, fixed_point::*}; use neural_network::{layers::convolution::*, tensors::*}; use rand::{Rng, SeedableRng}; use rand_chacha::ChaChaRng; fn generate_random_number<R: Rng>(rng: &mut R) -> (f64, ...
rust
Apache-2.0
92bc0071fa11570df6b048ae0f6937ced249bb5a
2026-01-04T20:24:11.030795Z
false
cshuaimin/scd
https://github.com/cshuaimin/scd/blob/9b243ffc37a64797d56ede4e29dc7704bb0702ed/src/app.rs
src/app.rs
use std::io; use std::thread; use std::time::{Duration, Instant}; use anyhow::{bail, Result}; use crossbeam_channel::{self as channel, select, Receiver}; use notify::RecommendedWatcher; use termion::{event::Key, input::TermRead, raw::IntoRawMode, screen::AlternateScreen}; use tui::backend::TermionBackend; use tui::lay...
rust
MIT
9b243ffc37a64797d56ede4e29dc7704bb0702ed
2026-01-04T20:24:43.087867Z
false
cshuaimin/scd
https://github.com/cshuaimin/scd/blob/9b243ffc37a64797d56ede4e29dc7704bb0702ed/src/system_monitor.rs
src/system_monitor.rs
use std::fmt::Write; use std::time::Instant; use sysinfo::{ProcessorExt, RefreshKind, System, SystemExt}; use tui::backend::Backend; use tui::buffer::Buffer; use tui::layout::{Constraint, Direction, Layout, Rect}; use tui::style::{Color, Modifier, Style}; use tui::widgets::{Paragraph, Text, Widget}; use tui::Frame; f...
rust
MIT
9b243ffc37a64797d56ede4e29dc7704bb0702ed
2026-01-04T20:24:43.087867Z
false
cshuaimin/scd
https://github.com/cshuaimin/scd/blob/9b243ffc37a64797d56ede4e29dc7704bb0702ed/src/status_bar.rs
src/status_bar.rs
use std::os::unix::fs::PermissionsExt; use std::time::{Duration, Instant}; use anyhow::Result; use notify::Watcher; use strmode::strmode; use termion::event::Key; use tui::backend::Backend; use tui::layout::{Alignment, Rect}; use tui::style::{Color, Style}; use tui::widgets::{Paragraph, Text}; use tui::Frame; use cra...
rust
MIT
9b243ffc37a64797d56ede4e29dc7704bb0702ed
2026-01-04T20:24:43.087867Z
false
cshuaimin/scd
https://github.com/cshuaimin/scd/blob/9b243ffc37a64797d56ede4e29dc7704bb0702ed/src/file_manager.rs
src/file_manager.rs
use std::cmp; use std::convert::TryFrom; use std::env; use std::fs::{self, DirEntry, Metadata}; use std::io; use std::mem; use std::os::unix::fs::PermissionsExt; use std::{ collections::HashMap, path::{Path, PathBuf}, }; use anyhow::Result; use crossbeam_channel::{self as channel, Receiver}; use notify::{Event...
rust
MIT
9b243ffc37a64797d56ede4e29dc7704bb0702ed
2026-01-04T20:24:43.087867Z
false
cshuaimin/scd
https://github.com/cshuaimin/scd/blob/9b243ffc37a64797d56ede4e29dc7704bb0702ed/src/task_manager.rs
src/task_manager.rs
use std::collections::HashMap; use std::env; use std::io::Write; use std::io::{self, BufRead, BufReader}; use std::process::{ChildStdin, Command, ExitStatus, Stdio}; use std::thread; use anyhow::Result; use crossbeam_channel::{self as channel, Receiver, Sender}; use nix::sys::signal::{kill, Signal}; use nix::unistd::P...
rust
MIT
9b243ffc37a64797d56ede4e29dc7704bb0702ed
2026-01-04T20:24:43.087867Z
false
cshuaimin/scd
https://github.com/cshuaimin/scd/blob/9b243ffc37a64797d56ede4e29dc7704bb0702ed/src/main.rs
src/main.rs
use std::path::PathBuf; use anyhow::Result; use structopt::StructOpt; use app::App; mod app; mod file_manager; mod shell; mod status_bar; mod system_monitor; mod task_manager; /// A tiny file manager focused on shell integration #[derive(Debug, StructOpt)] struct Opt { #[structopt(subcommand)] command: Opti...
rust
MIT
9b243ffc37a64797d56ede4e29dc7704bb0702ed
2026-01-04T20:24:43.087867Z
false
cshuaimin/scd
https://github.com/cshuaimin/scd/blob/9b243ffc37a64797d56ede4e29dc7704bb0702ed/src/shell/mod.rs
src/shell/mod.rs
use std::fs::{File, OpenOptions}; use std::io::prelude::*; use std::mem; use std::path::PathBuf; use anyhow::{ensure, Context, Result}; use crossbeam_channel::Sender; use nix::sys::signal::{kill, Signal}; use nix::sys::stat::Mode; use nix::unistd::{mkfifo, Pid}; use serde::{Deserialize, Serialize}; /// Send shell com...
rust
MIT
9b243ffc37a64797d56ede4e29dc7704bb0702ed
2026-01-04T20:24:43.087867Z
false
char-ptr/bsod-rs
https://github.com/char-ptr/bsod-rs/blob/67c534745bc918b1165d4f5fdd734703812c765f/src/lib.rs
src/lib.rs
/// # bsod /// The safest library on the block. Calling the bsod function will cause a blue screen of death. /// ## links /// - [`crates.io`](https://crates.io/crates/bsod) /// - [`docs.rs`](https://docs.rs/bsod/latest/bsod/) use std::{ ffi::{c_ulong, c_ulonglong, CString}, mem::transmute, }; #[cfg(target_os =...
rust
Unlicense
67c534745bc918b1165d4f5fdd734703812c765f
2026-01-04T20:24:44.192785Z
false
char-ptr/bsod-rs
https://github.com/char-ptr/bsod-rs/blob/67c534745bc918b1165d4f5fdd734703812c765f/examples/bsod.rs
examples/bsod.rs
use bsod::bsod; fn main() { bsod(); }
rust
Unlicense
67c534745bc918b1165d4f5fdd734703812c765f
2026-01-04T20:24:44.192785Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/lib.rs
nmrs/src/lib.rs
//! A Rust library for managing network connections via NetworkManager. //! //! This crate provides a high-level async API for NetworkManager over D-Bus, //! enabling easy management of WiFi, Ethernet, and VPN connections on Linux. //! //! # Quick Start //! //! ## WiFi Connection //! //! ```no_run //! use nmrs::{Networ...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/util/utils.rs
nmrs/src/util/utils.rs
//! Utility functions for Wi-Fi data conversion and display. //! //! Provides helpers for converting between Wi-Fi data representations: //! frequency to channel, signal strength to visual bars, SSID bytes to strings. use log::warn; use std::borrow::Cow; use std::str; use zbus::Connection; use crate::dbus::{NMAccessP...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/util/mod.rs
nmrs/src/util/mod.rs
//! Utility functions. //! //! This module contains helper functions used throughout the crate. pub(crate) mod utils;
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/dbus/device.rs
nmrs/src/dbus/device.rs
//! NetworkManager Device proxy. use zbus::{proxy, Result}; /// Proxy for NetworkManager device interface. /// /// Provides access to device properties like interface name, type, state, /// and the reason for state transitions. /// /// # Signals /// /// The `StateChanged` signal is emitted whenever the device state c...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/dbus/wired.rs
nmrs/src/dbus/wired.rs
//! NetworkManager Wired (Ethernet) Device Proxy use zbus::Result; use zbus::proxy; /// Proxy for wired devices (Ethernet). /// /// Provides access to wired-specific properties like carrier status. #[proxy( interface = "org.freedesktop.NetworkManager.Device.Wired", default_service = "org.freedesktop.NetworkMa...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/dbus/active_connection.rs
nmrs/src/dbus/active_connection.rs
//! NetworkManager Active Connection proxy. use zbus::{proxy, Result}; use zvariant::OwnedObjectPath; /// Proxy for active connection interface. /// /// Provides access to the state of an active (in-progress or established) /// network connection. Use this to monitor connection activation progress /// and detect fail...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/dbus/mod.rs
nmrs/src/dbus/mod.rs
//! D-Bus proxy interfaces for NetworkManager. //! //! This module contains low-level D-Bus proxy definitions for communicating //! with NetworkManager over the system bus. mod access_point; mod active_connection; mod device; mod main_nm; mod wireless; pub(crate) use access_point::NMAccessPointProxy; pub(crate) use a...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/dbus/wireless.rs
nmrs/src/dbus/wireless.rs
//! NetworkManager Wireless Device proxy. use std::collections::HashMap; use zbus::{proxy, Result}; use zvariant::OwnedObjectPath; /// Proxy for wireless device interface. /// /// Extends the base device interface with Wi-Fi specific functionality /// like scanning and access point enumeration. #[proxy( interface...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/dbus/main_nm.rs
nmrs/src/dbus/main_nm.rs
//! Main NetworkManager proxy. use std::collections::HashMap; use zbus::proxy; use zvariant::OwnedObjectPath; /// Proxy for the main NetworkManager interface. /// /// Provides methods for listing devices, managing connections, /// and controlling Wi-Fi state. #[proxy( interface = "org.freedesktop.NetworkManager",...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/dbus/access_point.rs
nmrs/src/dbus/access_point.rs
//! NetworkManager Access Point proxy. use zbus::{proxy, Result}; /// Proxy for access point interface. /// /// Provides information about a visible Wi-Fi network including /// SSID, signal strength, security capabilities, and frequency. #[proxy( interface = "org.freedesktop.NetworkManager.AccessPoint", defau...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/api/network_manager.rs
nmrs/src/api/network_manager.rs
use zbus::Connection; use crate::api::models::{Device, Network, NetworkInfo, WifiSecurity}; use crate::core::connection::{connect, connect_wired, forget}; use crate::core::connection_settings::{get_saved_connection_path, has_saved_connection}; use crate::core::device::{list_devices, set_wifi_enabled, wait_for_wifi_rea...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/api/mod.rs
nmrs/src/api/mod.rs
//! Public API module. //! //! This module contains the high-level user-facing API for the `nmrs` crate. pub mod builders; pub mod models; pub mod network_manager;
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/api/models.rs
nmrs/src/api/models.rs
use serde::{Deserialize, Serialize}; use std::fmt::{Display, Formatter}; use thiserror::Error; use uuid::Uuid; /// NetworkManager active connection state. /// /// These values represent the lifecycle states of an active connection /// as reported by the NM D-Bus API. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub en...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
true
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/api/builders/wifi.rs
nmrs/src/api/builders/wifi.rs
//! NetworkManager connection settings builder. //! //! Constructs the D-Bus settings dictionaries required by NetworkManager's //! `AddAndActivateConnection` method. These settings define the connection //! type, security parameters, and IP configuration. //! //! # NetworkManager Settings Structure //! //! A connectio...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/api/builders/mod.rs
nmrs/src/api/builders/mod.rs
//! Connection builders for different network types. //! //! This module provides functions to construct NetworkManager connection settings //! dictionaries for various connection types. These settings are used with //! NetworkManager's D-Bus API to create and activate connections. //! //! # Available Builders //! //! ...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/api/builders/vpn.rs
nmrs/src/api/builders/vpn.rs
//! VPN connection settings builders. //! //! This module provides functions to build NetworkManager settings dictionaries //! for VPN connections. Currently supports: //! //! - **WireGuard** - Modern, high-performance VPN protocol //! //! # Usage //! //! Most users should call [`NetworkManager::connect_vpn`][crate::Ne...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/types/mod.rs
nmrs/src/types/mod.rs
//! Type definitions and constants. //! //! This module contains NetworkManager constants and type definitions. pub(crate) mod constants;
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/types/constants.rs
nmrs/src/types/constants.rs
//! Constants for NetworkManager D-Bus interface values. //! //! These constants correspond to the numeric codes used by NetworkManager's //! D-Bus API for device types, states, security flags, and other values. /// NetworkManager device type constants. pub mod device_type { pub const ETHERNET: u32 = 1; pub co...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/monitoring/device.rs
nmrs/src/monitoring/device.rs
//! Real-time device state monitoring using D-Bus signals. //! //! Provides functionality to monitor device state changes (e.g., ethernet cable //! plugged in/out, device activation/deactivation) in real-time without needing //! to poll. This enables live UI updates for both wired and wireless devices. use futures::st...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/monitoring/network.rs
nmrs/src/monitoring/network.rs
//! Real-time network monitoring using D-Bus signals. //! //! Provides functionality to monitor access point changes (additions/removals) //! in real-time without needing to poll. This enables live UI updates. use futures::stream::{Stream, StreamExt}; use log::{debug, warn}; use std::pin::Pin; use zbus::Connection; u...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/monitoring/info.rs
nmrs/src/monitoring/info.rs
//! Network information and current connection status. //! //! Provides functions to retrieve detailed information about networks //! and query the current connection state. use zbus::Connection; use crate::api::models::{ConnectionError, Network, NetworkInfo}; #[allow(unused_imports)] // Used within try_log! macro us...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/monitoring/mod.rs
nmrs/src/monitoring/mod.rs
//! Real-time monitoring of network and device changes. //! //! This module provides functions for monitoring network state changes, //! device state changes, and retrieving current connection information. pub(crate) mod device; pub(crate) mod info; pub(crate) mod network;
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/core/device.rs
nmrs/src/core/device.rs
//! Network device enumeration and control. //! //! Provides functions for listing network devices, checking Wi-Fi state, //! and enabling/disabling Wi-Fi. Uses D-Bus signals for efficient state //! monitoring instead of polling. use log::debug; use zbus::Connection; use crate::api::models::{ConnectionError, Device, ...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/core/state_wait.rs
nmrs/src/core/state_wait.rs
//! Connection state monitoring using D-Bus signals. //! //! Provides functions to wait for device and connection state transitions //! using NetworkManager's signal-based API instead of polling. This approach //! is more efficient and provides faster response times. //! //! # Signal-Based Monitoring //! //! Instead of...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/core/connection_settings.rs
nmrs/src/core/connection_settings.rs
//! Saved connection profile management. //! //! Provides functions for querying and deleting saved NetworkManager //! connection profiles. Saved connections persist across reboots and //! store credentials for automatic reconnection. use log::debug; use std::collections::HashMap; use zbus::Connection; use zvariant::{...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/core/connection.rs
nmrs/src/core/connection.rs
use futures_timer::Delay; use log::{debug, error, info, warn}; use std::collections::HashMap; use zbus::Connection; use zvariant::OwnedObjectPath; use crate::api::builders::wifi::{build_ethernet_connection, build_wifi_connection}; use crate::api::models::{ConnectionError, ConnectionOptions, WifiSecurity}; use crate::c...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/core/mod.rs
nmrs/src/core/mod.rs
//! Core internal logic for connection management. //! //! This module contains the internal implementation details for managing //! network connections, devices, scanning, and state monitoring. pub(crate) mod connection; pub(crate) mod connection_settings; pub(crate) mod device; pub(crate) mod scan; pub(crate) mod st...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/core/vpn.rs
nmrs/src/core/vpn.rs
//! Core VPN connection management logic. //! //! This module contains internal implementation for managing VPN connections //! through NetworkManager, including connecting, disconnecting, listing, and //! deleting VPN profiles. //! //! Currently supports: //! - WireGuard connections (NetworkManager connection.type == ...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/src/core/scan.rs
nmrs/src/core/scan.rs
//! Wi-Fi network scanning and enumeration. //! //! Provides functions to trigger Wi-Fi scans and list visible networks //! with their properties (SSID, signal strength, security type). use std::collections::HashMap; use zbus::Connection; use crate::api::models::Network; use crate::dbus::{NMDeviceProxy, NMProxy, NMWi...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/tests/integration_test.rs
nmrs/tests/integration_test.rs
use nmrs::{ reason_to_error, ConnectionError, DeviceState, DeviceType, NetworkManager, StateReason, VpnCredentials, VpnType, WifiSecurity, WireGuardPeer, }; use std::time::Duration; use tokio::time::sleep; /// Helper function to check if NetworkManager is available /// Returns true if we can connect to Network...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/examples/wifi_scan.rs
nmrs/examples/wifi_scan.rs
use nmrs::NetworkManager; #[tokio::main] async fn main() -> nmrs::Result<()> { let nm = NetworkManager::new().await?; println!("Scanning for WiFi networks..."); nm.scan_networks().await?; let networks = nm.list_networks().await?; for net in networks { println!("{:30} {}%", net.ssid, net.s...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs/examples/vpn_connect.rs
nmrs/examples/vpn_connect.rs
use nmrs::{NetworkManager, VpnCredentials, VpnType, WireGuardPeer}; #[tokio::main] async fn main() -> nmrs::Result<()> { let nm = NetworkManager::new().await?; let creds = VpnCredentials { vpn_type: VpnType::WireGuard, name: "ExampleVPN".into(), gateway: "vpn.example.com:51820".into(),...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/build.rs
nmrs-gui/build.rs
use std::process::Command; fn main() { let output = Command::new("git") .args(["rev-parse", "--short", "HEAD"]) .output(); let hash = match output { Ok(output) if output.status.success() => { String::from_utf8_lossy(&output.stdout).trim().to_string() } _ => ...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/lib.rs
nmrs-gui/src/lib.rs
pub mod file_lock; pub mod objects; pub mod style; pub mod theme_config; pub mod ui; use clap::{ArgAction, Parser}; use gtk::prelude::*; use gtk::Application; use crate::file_lock::acquire_app_lock; use crate::style::load_css; use crate::ui::build_ui; #[derive(Parser, Debug)] #[command(name = "nmrs")] #[command(disa...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/theme_config.rs
nmrs-gui/src/theme_config.rs
use std::fs; use std::path::PathBuf; fn get_config_path() -> Option<PathBuf> { dirs::config_dir().map(|mut path| { path.push("nmrs"); fs::create_dir_all(&path).ok()?; path.push("theme"); Some(path) })? } /// Save the selected theme *name* (e.g. "nord", "gruvbox", "dracula") pub...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/style.rs
nmrs-gui/src/style.rs
use gtk::gdk::Display; use gtk::gio::File; use gtk::{CssProvider, STYLE_PROVIDER_PRIORITY_APPLICATION, STYLE_PROVIDER_PRIORITY_USER}; use std::fs; use std::io::Write; fn load_user_css_if_exists(display: &Display, default: &str) { let path = dirs::config_dir() .unwrap_or_default() .join("nmrs/style....
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/file_lock.rs
nmrs-gui/src/file_lock.rs
use fs2::FileExt; use std::fs::File; pub fn acquire_app_lock() -> Result<File, String> { let mut lock_path = dirs::data_local_dir().unwrap_or(std::env::temp_dir()); lock_path.push("my_app.lock"); let file = File::create(&lock_path).map_err(|e| format!("Failed to create lock file: {e}"))?; // Exclusiv...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/main.rs
nmrs-gui/src/main.rs
#[tokio::main(flavor = "current_thread")] async fn main() { nmrs_gui::run().ok(); }
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/ui/networks.rs
nmrs-gui/src/ui/networks.rs
use anyhow::Result; use gtk::prelude::*; use gtk::Align; use gtk::GestureClick; use gtk::{Box, Image, Label, ListBox, ListBoxRow, Orientation}; use nmrs::models::WifiSecurity; use nmrs::{models, NetworkManager}; use std::rc::Rc; use crate::ui::connect; use crate::ui::network_page::NetworkPage; pub struct NetworkRowCo...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/ui/wired_page.rs
nmrs-gui/src/ui/wired_page.rs
use glib::clone; use gtk::prelude::*; use gtk::{Align, Box, Button, Image, Label, Orientation}; use nmrs::models::Device; pub struct WiredPage { root: gtk::Box, title: gtk::Label, state_label: gtk::Label, interface: gtk::Label, device_type: gtk::Label, mac_address: gtk::Label, driver: gtk...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/ui/connect.rs
nmrs-gui/src/ui/connect.rs
use glib::Propagation; use gtk::{ prelude::*, ApplicationWindow, Box as GtkBox, Button, CheckButton, Dialog, Entry, EventControllerKey, FileChooserAction, FileChooserDialog, Label, Orientation, ResponseType, }; use log::{debug, error}; use nmrs::{ models::{EapMethod, EapOptions, Phase2, WifiSecurity}, N...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/ui/header.rs
nmrs-gui/src/ui/header.rs
use glib::clone; use gtk::prelude::*; use gtk::STYLE_PROVIDER_PRIORITY_USER; use gtk::{glib, Align, Box as GtkBox, HeaderBar, Label, ListBox, Orientation, Switch}; use std::cell::Cell; use std::collections::HashSet; use std::rc::Rc; use nmrs::models; use crate::ui::networks; use crate::ui::networks::NetworksContext; ...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/ui/wired_devices.rs
nmrs-gui/src/ui/wired_devices.rs
use gtk::prelude::*; use gtk::Align; use gtk::GestureClick; use gtk::{Box, Image, Label, ListBox, ListBoxRow, Orientation}; use nmrs::{models, NetworkManager}; use std::rc::Rc; use crate::ui::wired_page::WiredPage; pub struct WiredDeviceRowController { pub row: gtk::ListBoxRow, pub arrow: gtk::Image, pub ...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false
cachebag/nmrs
https://github.com/cachebag/nmrs/blob/411987cb7691206b7135594ef65d3f37bc1e7958/nmrs-gui/src/ui/mod.rs
nmrs-gui/src/ui/mod.rs
pub mod connect; pub mod header; pub mod network_page; pub mod networks; pub mod wired_devices; pub mod wired_page; use gtk::prelude::*; use gtk::{ Application, ApplicationWindow, Box as GtkBox, Label, Orientation, ScrolledWindow, Spinner, Stack, STYLE_PROVIDER_PRIORITY_USER, }; use std::cell::Cell; use std::r...
rust
MIT
411987cb7691206b7135594ef65d3f37bc1e7958
2026-01-04T20:24:43.919455Z
false