Skip to content

Commit

Permalink
Merge branch 'dev/1.0.0' into peers_interests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets authored May 30, 2024
2 parents f7bf8be + 1cb33c0 commit 69a70be
Show file tree
Hide file tree
Showing 86 changed files with 661 additions and 582 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion ci/valgrind-check/src/pub_sub/bin/z_pub_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//
use std::time::Duration;

use zenoh::{config::Config, prelude::*};
use zenoh::{config::Config, key_expr::KeyExpr, prelude::*};

#[tokio::main]
async fn main() {
Expand Down
4 changes: 3 additions & 1 deletion ci/valgrind-check/src/queryable_get/bin/z_queryable_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
//
use std::{convert::TryFrom, time::Duration};

use zenoh::{config::Config, prelude::*};
use zenoh::{
config::Config, key_expr::KeyExpr, prelude::*, query::QueryTarget, selector::Selector,
};

#[tokio::main]
async fn main() {
Expand Down
8 changes: 4 additions & 4 deletions commons/zenoh-shm/src/api/provider/shared_memory_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ pub trait AllocPolicy {
/// Trait for async allocation policies
#[zenoh_macros::unstable_doc]
#[async_trait]
pub trait AsyncAllocPolicy {
pub trait AsyncAllocPolicy: Send {
async fn alloc_async<IDSource: ProtocolIDSource, Backend: SharedMemoryProviderBackend + Sync>(
layout: &MemoryLayout,
provider: &SharedMemoryProvider<IDSource, Backend>,
Expand Down Expand Up @@ -420,7 +420,7 @@ where
#[async_trait]
impl<InnerPolicy> AsyncAllocPolicy for BlockOn<InnerPolicy>
where
InnerPolicy: AllocPolicy,
InnerPolicy: AllocPolicy + Send,
{
async fn alloc_async<
IDSource: ProtocolIDSource,
Expand Down Expand Up @@ -577,7 +577,7 @@ where
Policy: AsyncAllocPolicy,
{
type Output = <Self as Resolvable>::To;
type IntoFuture = Pin<Box<dyn Future<Output = <Self as Resolvable>::To> + 'a>>;
type IntoFuture = Pin<Box<dyn Future<Output = <Self as IntoFuture>::Output> + 'a + Send>>;

fn into_future(self) -> Self::IntoFuture {
Box::pin(
Expand Down Expand Up @@ -652,7 +652,7 @@ where
Policy: AsyncAllocPolicy,
{
type Output = <Self as Resolvable>::To;
type IntoFuture = Pin<Box<dyn Future<Output = <Self as Resolvable>::To> + 'a>>;
type IntoFuture = Pin<Box<dyn Future<Output = <Self as Resolvable>::To> + 'a + Send>>;

fn into_future(self) -> Self::IntoFuture {
Box::pin(
Expand Down
24 changes: 0 additions & 24 deletions config.json5

This file was deleted.

9 changes: 8 additions & 1 deletion examples/examples/z_alloc_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
use zenoh::prelude::*;
use zenoh::{
prelude::*,
shm::{
AllocAlignment, BlockOn, Deallocate, Defragment, GarbageCollect,
PosixSharedMemoryProviderBackend, SharedMemoryProviderBuilder, POSIX_PROTOCOL_ID,
},
Config,
};

#[tokio::main]
async fn main() {
Expand Down
9 changes: 8 additions & 1 deletion examples/examples/z_bytes_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
use zenoh::prelude::*;
use zenoh::{
bytes::ZBytes,
prelude::*,
shm::{
zshm, zshmmut, PosixSharedMemoryProviderBackend, SharedMemoryProviderBuilder, ZShm,
ZShmMut, POSIX_PROTOCOL_ID,
},
};

fn main() {
// create an SHM backend...
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_delete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::KeyExpr, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
9 changes: 4 additions & 5 deletions examples/examples/z_formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//

use zenoh::prelude as zenoh;

use zenoh::key_expr::keyexpr;
zenoh::kedefine!(
pub file_format: "user_id/${user_id:*}/file/${file:*/**}",
pub(crate) settings_format: "user_id/${user_id:*}/settings/${setting:**}"
Expand All @@ -26,8 +25,8 @@ fn main() {
let ke = zenoh::keformat!(formatter, user_id = 42, file).unwrap();
println!("{formatter:?} => {ke}");
// Parsing
let settings_ke = zenoh::keyexpr::new("user_id/30/settings/dark_mode").unwrap();
let settings_ke = keyexpr::new("user_id/30/settings/dark_mode").unwrap();
let parsed = settings_format::parse(settings_ke).unwrap();
assert_eq!(parsed.user_id(), zenoh::keyexpr::new("30").unwrap());
assert_eq!(parsed.setting(), zenoh::keyexpr::new("dark_mode").ok());
assert_eq!(parsed.user_id(), keyexpr::new("30").unwrap());
assert_eq!(parsed.setting(), keyexpr::new("dark_mode").ok());
}
2 changes: 1 addition & 1 deletion examples/examples/z_forward.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::KeyExpr, prelude::*, Config};
use zenoh_examples::CommonArgs;
use zenoh_ext::SubscriberForward;

Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use std::time::Duration;

use clap::Parser;
use zenoh::prelude::*;
use zenoh::{prelude::*, query::QueryTarget, selector::Selector, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_get_liveliness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use std::time::Duration;

use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::KeyExpr, prelude::*, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
11 changes: 10 additions & 1 deletion examples/examples/z_get_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
use std::time::Duration;

use clap::Parser;
use zenoh::prelude::*;
use zenoh::{
prelude::*,
query::QueryTarget,
selector::Selector,
shm::{
zshm, BlockOn, GarbageCollect, PosixSharedMemoryProviderBackend,
SharedMemoryProviderBuilder, POSIX_PROTOCOL_ID,
},
Config,
};
use zenoh_examples::CommonArgs;

const N: usize = 10;
Expand Down
4 changes: 2 additions & 2 deletions examples/examples/z_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{config::ZenohId, prelude::*};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down Expand Up @@ -43,7 +43,7 @@ struct Args {
common: CommonArgs,
}

fn parse_args() -> Config {
fn parse_args() -> zenoh::Config {
let args = Args::parse();
args.common.into()
}
2 changes: 1 addition & 1 deletion examples/examples/z_liveliness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::KeyExpr, prelude::*, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use std::time::{Duration, Instant};

use clap::Parser;
use zenoh::prelude::*;
use zenoh::{bytes::ZBytes, key_expr::keyexpr, prelude::*, publisher::CongestionControl, Config};
use zenoh_examples::CommonArgs;

fn main() {
Expand Down
9 changes: 8 additions & 1 deletion examples/examples/z_ping_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@
use std::time::{Duration, Instant};

use clap::Parser;
use zenoh::prelude::*;
use zenoh::{
buffers::ZSlice,
key_expr::keyexpr,
prelude::*,
publisher::CongestionControl,
shm::{PosixSharedMemoryProviderBackend, SharedMemoryProviderBuilder, POSIX_PROTOCOL_ID},
Config,
};
use zenoh_examples::CommonArgs;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_pong.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::keyexpr, prelude::*, publisher::CongestionControl, Config};
use zenoh_examples::CommonArgs;

fn main() {
Expand Down
5 changes: 4 additions & 1 deletion examples/examples/z_posix_shm_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
use zenoh::prelude::*;
use zenoh::shm::{
AllocAlignment, MemoryLayout, PosixSharedMemoryProviderBackend, SharedMemoryProviderBuilder,
POSIX_PROTOCOL_ID,
};

fn main() {
// Construct an SHM backend
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_pub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use std::time::Duration;

use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::KeyExpr, prelude::*, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
10 changes: 9 additions & 1 deletion examples/examples/z_pub_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{
key_expr::KeyExpr,
prelude::*,
shm::{
BlockOn, GarbageCollect, PosixSharedMemoryProviderBackend, SharedMemoryProviderBuilder,
POSIX_PROTOCOL_ID,
},
Config,
};
use zenoh_examples::CommonArgs;

const N: usize = 10;
Expand Down
8 changes: 7 additions & 1 deletion examples/examples/z_pub_shm_thr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{
buffers::ZSlice,
prelude::*,
publisher::CongestionControl,
shm::{PosixSharedMemoryProviderBackend, SharedMemoryProviderBuilder, POSIX_PROTOCOL_ID},
Config,
};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
6 changes: 5 additions & 1 deletion examples/examples/z_pub_thr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
use std::convert::TryInto;

use clap::Parser;
use zenoh::prelude::*;
use zenoh::{
bytes::ZBytes,
prelude::*,
publisher::{CongestionControl, Priority},
};
use zenoh_examples::CommonArgs;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use std::time::Duration;

use clap::Parser;
use zenoh::prelude::*;
use zenoh::{handlers::RingChannel, key_expr::KeyExpr, prelude::*, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_put.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::KeyExpr, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_put_float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::KeyExpr, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_queryable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{key_expr::KeyExpr, prelude::*, Config};
use zenoh_examples::CommonArgs;

#[tokio::main]
Expand Down
10 changes: 9 additions & 1 deletion examples/examples/z_queryable_shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@
// ZettaScale Zenoh Team, <[email protected]>
//
use clap::Parser;
use zenoh::prelude::*;
use zenoh::{
key_expr::KeyExpr,
prelude::*,
shm::{
zshm, BlockOn, GarbageCollect, PosixSharedMemoryProviderBackend,
SharedMemoryProviderBuilder, POSIX_PROTOCOL_ID,
},
Config,
};
use zenoh_examples::CommonArgs;

const N: usize = 10;
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/z_scout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
use zenoh::prelude::*;
use zenoh::{config::WhatAmI, scout, Config};

#[tokio::main]
async fn main() {
Expand Down
Loading

0 comments on commit 69a70be

Please sign in to comment.