Skip to content

Commit

Permalink
Rename everything to lazuli
Browse files Browse the repository at this point in the history
  • Loading branch information
quackitsquinn committed May 16, 2024
1 parent 59432d7 commit 8357a7e
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 56 deletions.
68 changes: 34 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

[package]
name = "rsock"
name = "lazuli"
version = "0.1.0"
edition = "2021"

[workspace]
members = ["rsocks", "rsocks_derive"]
members = ["lazuli_core", "lazuli_derive"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rsocks = { path = "rsocks" }
rsocks_derive = { path = "rsocks_derive" }
lazuli_core = { path = "lazuli_core" }
lazuli_derive = { path = "lazuli_derive" }

2 changes: 1 addition & 1 deletion examples/hello_world.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};

use rsock::{Client, Server};
use lazuli::{Client, Server};

const ADDRESS: SocketAddr = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::LOCALHOST, 8080));

Expand Down
2 changes: 1 addition & 1 deletion rsocks/Cargo.toml → lazuli_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "rsocks"
name = "lazuli_core"
version = "0.1.0"
edition = "2021"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion rsocks_derive/Cargo.toml → lazuli_derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "rsocks_derive"
name = "lazuli_derive"
version = "0.1.0"
edition = "2021"

Expand Down
10 changes: 5 additions & 5 deletions rsocks_derive/src/lib.rs → lazuli_derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn impl_sendable(ast: &syn::DeriveInput) -> proc_macro::TokenStream {
.map(|(ty, _)| {
quote! {
const _: fn() = || {
fn _assert_sendable<T: rsocks::Sendable>() {}
fn _assert_sendable<T: lazuli_core::Sendable>() {}
_assert_sendable::<#ty>();
};
}
Expand All @@ -75,7 +75,7 @@ fn impl_sendable(ast: &syn::DeriveInput) -> proc_macro::TokenStream {

#field_impl_check // Check that all fields implement Sendable

impl rsocks::Sendable for #name {
impl lazuli_core::Sendable for #name {

fn size(&self) -> u32 {
let mut size = 0;
Expand Down Expand Up @@ -132,7 +132,7 @@ fn generate_size(input: &syn::DataStruct) -> TokenStream2 {
|ident, field| {
let ty = &field.ty;
quote! {
size += <#ty as rsocks::Sendable>::size(&self.#ident);
size += <#ty as lazuli_core::Sendable>::size(&self.#ident);
}
},
input,
Expand Down Expand Up @@ -161,7 +161,7 @@ fn generate_recv(input: &syn::DataStruct, name: &Ident) -> TokenStream2 {
let ty = &field.ty;
let ident = field.ident.as_ref().unwrap();
quote! {
#ident: <#ty as rsocks::Sendable>::recv(data)?,
#ident: <#ty as lazuli_core::Sendable>::recv(data)?,
}
})
.collect();
Expand All @@ -179,7 +179,7 @@ fn generate_recv(input: &syn::DataStruct, name: &Ident) -> TokenStream2 {
.map(|(_, field)| {
let ty = &field.ty;
quote! {
<#ty as rsocks::Sendable>::recv(data)?,
<#ty as lazuli_core::Sendable>::recv(data)?,
}
})
.collect();
Expand Down
17 changes: 7 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
//! # rsocks: A TCP socket library oriented for game design
//!
pub use rsocks::*;
pub use rsocks_derive::Sendable;
pub use lazuli_core::*;
pub use lazuli_derive::Sendable;

#[cfg(test)]
mod tests {
use std::io::Cursor;

use rsocks::Sendable;
use lazuli_core::Sendable;

#[derive(rsocks_derive::Sendable, PartialEq, Debug)]
#[derive(lazuli_derive::Sendable, PartialEq, Debug)]
struct TestSendable {
uint32_1: u32,
uint32_2: u32,
Expand All @@ -31,7 +28,7 @@ mod tests {
assert_eq!(test, test2);
}

#[derive(rsocks_derive::Sendable, PartialEq, Debug)]
#[derive(lazuli_derive::Sendable, PartialEq, Debug)]
struct TestSendable2 {
sendable: TestSendable,
vec_u32: Vec<u32>,
Expand Down Expand Up @@ -75,7 +72,7 @@ mod tests {
assert_eq!(test, received);
}

#[derive(rsocks_derive::Sendable, Debug, PartialEq)]
#[derive(lazuli_derive::Sendable, Debug, PartialEq)]
struct TestSendable3 {
a: TestSendable2,
b: Vec<u32>,
Expand All @@ -98,7 +95,7 @@ mod tests {
assert_eq!(constructed, received);
}

#[derive(rsocks_derive::Sendable, Debug, PartialEq)]
#[derive(lazuli_derive::Sendable, Debug, PartialEq)]
struct TupleTest(u32, u32);

#[test]
Expand Down

0 comments on commit 8357a7e

Please sign in to comment.