Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properties renamed to parameters, selector rework #1100

Merged
merged 50 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
438804f
properties renamed to parameters, selector rework
milyin Jun 9, 2024
a65686a
from (Keyexp, Parameters) added
milyin Jun 9, 2024
4989f4f
attachment made stable
milyin Jun 9, 2024
75fbda2
one more unstable remove
milyin Jun 9, 2024
6b541fc
use moved out of unstable
milyin Jun 9, 2024
9bf86e8
cargo fmt
milyin Jun 9, 2024
5d195e8
Merge branch 'attachment_stable' into selector_rework3
milyin Jun 9, 2024
634f09f
Merge branch 'dev/1.0.0' into selector_rework3
milyin Jun 10, 2024
2f01adc
reply_key_expr in trait
milyin Jun 10, 2024
b84bd90
Merge branch 'selector_rework3' of github.com:eclipse-zenoh/zenoh int…
milyin Jun 10, 2024
357b90e
Merge branch 'dev/1.0.0' into selector_rework3
milyin Jun 11, 2024
63ca9cb
parameters temporary renamed back, clippy fixes
milyin Jun 11, 2024
e77401e
simplified code
milyin Jun 11, 2024
4b4c6cb
unstable predefined parameters unfinihsed
milyin Jun 11, 2024
81c2dc6
Merge branch 'dev/1.0.0' into selector_rework3
milyin Jun 12, 2024
3393cdc
cargo fmt
milyin Jun 12, 2024
6a5bd62
clippy fix
milyin Jun 12, 2024
ff560e7
module reorg
milyin Jun 12, 2024
10158d6
more renamings
milyin Jun 12, 2024
825bfe4
more renamings
milyin Jun 12, 2024
0bcbc55
cargo fmt
milyin Jun 12, 2024
296c325
doc fix
milyin Jun 12, 2024
97be160
Merge branch 'dev/1.0.0' into selector_rework3
milyin Jun 12, 2024
906215b
after merge updates
milyin Jun 12, 2024
7ff7e81
no import of parameters::* into root of zenoh-protocol
milyin Jun 12, 2024
1bbbc9a
clippy fixes
milyin Jun 12, 2024
0e5ca0d
comment updated
milyin Jun 12, 2024
222af45
cargo fmt
milyin Jun 12, 2024
f66d181
accidental renaming fix
milyin Jun 12, 2024
2aabd7e
Merge branch 'dev/1.0.0' into selector_rework3
milyin Jun 13, 2024
0006d95
Properties Variable renamed to parameters
Mallets Jun 13, 2024
560cb8f
Merge branch 'dev/1.0.0' into selector_rework3
milyin Jun 13, 2024
e81e7f3
Merge dev/1.0.0
Mallets Jun 13, 2024
e1dd672
Merge branch 'selector_rework3' of github.com:eclipse-zenoh/zenoh int…
milyin Jun 13, 2024
7632742
Fix z_get_shm
Mallets Jun 13, 2024
3288900
Improve docs
Mallets Jun 13, 2024
69619b6
restored selector parameter in example
milyin Jun 13, 2024
1f53840
Merge branch 'selector_rework3' of github.com:eclipse-zenoh/zenoh int…
milyin Jun 13, 2024
73bde69
Rename PredefinedParameters to ZenohParameters
Mallets Jun 13, 2024
fbba8bd
Merge branch 'selector_rework3' of github.com:eclipse-zenoh/zenoh int…
Mallets Jun 13, 2024
9250f75
ZenohParameters renaming, comment added
milyin Jun 13, 2024
b8e424c
Merge branch 'selector_rework3' of github.com:eclipse-zenoh/zenoh int…
milyin Jun 13, 2024
cee80ba
cargio fmt
milyin Jun 13, 2024
f73d519
Fix unicity tests
Mallets Jun 13, 2024
c73bac2
Merge dev/1.0.0
Mallets Jun 13, 2024
2bfed1a
Use Parameters::empty()
Mallets Jun 13, 2024
f3d0338
Fix --no-default-features
Mallets Jun 13, 2024
3a0bcf6
Fix --no-default-features
Mallets Jun 13, 2024
1123995
Fix cargo fmt
Mallets Jun 13, 2024
ad22c81
Fix wrong use
Mallets Jun 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions commons/zenoh-protocol/src/core/endpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use core::{borrow::Borrow, convert::TryFrom, fmt, str::FromStr};

use zenoh_result::{bail, zerror, Error as ZError, ZResult};

use super::{locator::*, parameters::Parameters};
use super::{locator::*, parameters};

// Parsing chars
pub const PROTO_SEPARATOR: char = '/';
Expand Down Expand Up @@ -196,15 +196,15 @@ impl<'a> Metadata<'a> {
}

pub fn iter(&'a self) -> impl DoubleEndedIterator<Item = (&'a str, &'a str)> + Clone {
Parameters::iter(self.0)
parameters::iter(self.0)
}

pub fn get(&'a self, k: &str) -> Option<&'a str> {
Parameters::get(self.0, k)
parameters::get(self.0, k)
}

pub fn values(&'a self, k: &str) -> impl DoubleEndedIterator<Item = &'a str> {
Parameters::values(self.0, k)
parameters::values(self.0, k)
}
}

Expand Down Expand Up @@ -250,7 +250,7 @@ impl MetadataMut<'_> {
let ep = EndPoint::new(
self.0.protocol(),
self.0.address(),
Parameters::from_iter(Parameters::sort(Parameters::join(
parameters::from_iter(parameters::sort(parameters::join(
self.0.metadata().iter(),
iter.map(|(k, v)| (k.borrow(), v.borrow())),
))),
Expand All @@ -269,7 +269,7 @@ impl MetadataMut<'_> {
let ep = EndPoint::new(
self.0.protocol(),
self.0.address(),
Parameters::insert_sort(self.0.metadata().as_str(), k.borrow(), v.borrow()).0,
parameters::insert_sort(self.0.metadata().as_str(), k.borrow(), v.borrow()).0,
self.0.config(),
)?;

Expand All @@ -284,7 +284,7 @@ impl MetadataMut<'_> {
let ep = EndPoint::new(
self.0.protocol(),
self.0.address(),
Parameters::remove(self.0.metadata().as_str(), k.borrow()).0,
parameters::remove(self.0.metadata().as_str(), k.borrow()).0,
self.0.config(),
)?;

Expand Down Expand Up @@ -326,15 +326,15 @@ impl<'a> Config<'a> {
}

pub fn iter(&'a self) -> impl DoubleEndedIterator<Item = (&'a str, &'a str)> + Clone {
Parameters::iter(self.0)
parameters::iter(self.0)
}

pub fn get(&'a self, k: &str) -> Option<&'a str> {
Parameters::get(self.0, k)
parameters::get(self.0, k)
}

pub fn values(&'a self, k: &str) -> impl DoubleEndedIterator<Item = &'a str> {
Parameters::values(self.0, k)
parameters::values(self.0, k)
}
}

Expand Down Expand Up @@ -381,7 +381,7 @@ impl ConfigMut<'_> {
self.0.protocol(),
self.0.address(),
self.0.metadata(),
Parameters::from_iter(Parameters::sort(Parameters::join(
parameters::from_iter(parameters::sort(parameters::join(
self.0.config().iter(),
iter.map(|(k, v)| (k.borrow(), v.borrow())),
))),
Expand All @@ -400,7 +400,7 @@ impl ConfigMut<'_> {
self.0.protocol(),
self.0.address(),
self.0.metadata(),
Parameters::insert_sort(self.0.config().as_str(), k.borrow(), v.borrow()).0,
parameters::insert_sort(self.0.config().as_str(), k.borrow(), v.borrow()).0,
)?;

self.0.inner = ep.inner;
Expand All @@ -415,7 +415,7 @@ impl ConfigMut<'_> {
self.0.protocol(),
self.0.address(),
self.0.metadata(),
Parameters::remove(self.0.config().as_str(), k.borrow()).0,
parameters::remove(self.0.config().as_str(), k.borrow()).0,
)?;

self.0.inner = ep.inner;
Expand Down Expand Up @@ -577,8 +577,8 @@ impl TryFrom<String> for EndPoint {
(Some(midx), None) if midx > pidx && !s[midx + 1..].is_empty() => {
let mut inner = String::with_capacity(s.len());
inner.push_str(&s[..midx + 1]); // Includes metadata separator
Parameters::from_iter_into(
Parameters::sort(Parameters::iter(&s[midx + 1..])),
parameters::from_iter_into(
parameters::sort(parameters::iter(&s[midx + 1..])),
&mut inner,
);
Ok(EndPoint { inner })
Expand All @@ -587,8 +587,8 @@ impl TryFrom<String> for EndPoint {
(None, Some(cidx)) if cidx > pidx && !s[cidx + 1..].is_empty() => {
let mut inner = String::with_capacity(s.len());
inner.push_str(&s[..cidx + 1]); // Includes config separator
Parameters::from_iter_into(
Parameters::sort(Parameters::iter(&s[cidx + 1..])),
parameters::from_iter_into(
parameters::sort(parameters::iter(&s[cidx + 1..])),
&mut inner,
);
Ok(EndPoint { inner })
Expand All @@ -603,14 +603,14 @@ impl TryFrom<String> for EndPoint {
let mut inner = String::with_capacity(s.len());
inner.push_str(&s[..midx + 1]); // Includes metadata separator

Parameters::from_iter_into(
Parameters::sort(Parameters::iter(&s[midx + 1..cidx])),
parameters::from_iter_into(
parameters::sort(parameters::iter(&s[midx + 1..cidx])),
&mut inner,
);

inner.push(CONFIG_SEPARATOR);
Parameters::from_iter_into(
Parameters::sort(Parameters::iter(&s[cidx + 1..])),
parameters::from_iter_into(
parameters::sort(parameters::iter(&s[cidx + 1..])),
&mut inner,
);

Expand Down Expand Up @@ -655,11 +655,11 @@ impl EndPoint {

if rng.gen_bool(0.5) {
endpoint.push(METADATA_SEPARATOR);
Parameters::rand(&mut endpoint);
parameters::rand(&mut endpoint);
}
if rng.gen_bool(0.5) {
endpoint.push(CONFIG_SEPARATOR);
Parameters::rand(&mut endpoint);
parameters::rand(&mut endpoint);
}

endpoint.parse().unwrap()
Expand Down
6 changes: 2 additions & 4 deletions commons/zenoh-protocol/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,9 @@ pub mod resolution;
pub use resolution::*;

pub mod parameters;
pub use parameters::*;

pub mod properties;
pub use properties::*;
pub use parameters::Parameters;

/// The global unique id of a zenoh peer.
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(transparent)]
pub struct ZenohIdProto(uhlc::ID);
Expand Down
Loading
Loading