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

Fixed #1976 - fe2o3-amqp should be fe2o3_amqp #2275

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions sdk/core/azure_core_amqp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ typespec = { workspace = true, features = ["amqp"] }
tracing-subscriber = { workspace = true, features = ["env-filter"] }

[features]
default = ["fe2o3-amqp"]
default = ["fe2o3_amqp"]
cplusplus = []
fe2o3-amqp = [
fe2o3_amqp = [
"dep:fe2o3-amqp",
"fe2o3-amqp-types",
"fe2o3-amqp-ext",
Expand All @@ -48,4 +48,4 @@ fe2o3-amqp = [
]

[package.metadata.docs.rs]
features = ["fe2o3-amqp"]
features = ["fe2o3_amqp"]
4 changes: 2 additions & 2 deletions sdk/core/azure_core_amqp/src/cbs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use azure_core::error::Result;

use super::session::AmqpSession;

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
type CbsImplementation<'a> = super::fe2o3::cbs::Fe2o3ClaimsBasedSecurity<'a>;

#[cfg(any(not(any(feature = "fe2o3-amqp")), target_arch = "wasm32"))]
#[cfg(any(not(any(feature = "fe2o3_amqp")), target_arch = "wasm32"))]
type CbsImplementation<'a> = super::noop::NoopAmqpClaimsBasedSecurity<'a>;

pub trait AmqpClaimsBasedSecurityApis {
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure_core_amqp/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use azure_core::{error::Result, Url};
use std::fmt::Debug;
use time::Duration;

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
type ConnectionImplementation = super::fe2o3::connection::Fe2o3AmqpConnection;

#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
type ConnectionImplementation = super::noop::NoopAmqpConnection;

/// Options for configuring an AMQP connection.
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure_core_amqp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

#![doc = include_str!("../README.md")]

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
mod fe2o3;

#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
mod noop;

pub(crate) mod cbs;
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure_core_amqp/src/management.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use super::{
};
use azure_core::{credentials::AccessToken, error::Result};

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
type ManagementImplementation = super::fe2o3::management::Fe2o3AmqpManagement;

#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
type ManagementImplementation = super::noop::NoopAmqpManagement;

pub trait AmqpManagementApis {
Expand Down
18 changes: 9 additions & 9 deletions sdk/core/azure_core_amqp/src/messaging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
// Licensed under the MIT license.

use super::value::{AmqpList, AmqpOrderedMap, AmqpSymbol, AmqpTimestamp, AmqpValue};
#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
use crate::fe2o3::error::Fe2o3SerializationError;
#[cfg(feature = "cplusplus")]
use crate::Deserializable;
#[cfg(feature = "cplusplus")]
use azure_core::error::ErrorKind;
use azure_core::{Result, Uuid};

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
type DeliveryImplementation = super::fe2o3::messaging::messaging_types::Fe2o3AmqpDelivery;

#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
type DeliveryImplementation = super::noop::NoopAmqpDelivery;

#[derive(Debug, Clone, PartialEq)]
Expand Down Expand Up @@ -1153,7 +1153,7 @@ impl AmqpMessage {

#[allow(unused_variables)]
pub fn serialize(message: &AmqpMessage) -> Result<Vec<u8>> {
#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
{
let amqp_message: fe2o3_amqp_types::messaging::Message<
fe2o3_amqp_types::messaging::Body<fe2o3_amqp_types::primitives::Value>,
Expand All @@ -1164,7 +1164,7 @@ impl AmqpMessage {
.map_err(|e| azure_core::Error::from(Fe2o3SerializationError(e)))?;
Ok(res)
}
#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
{
unimplemented!();
}
Expand Down Expand Up @@ -1215,7 +1215,7 @@ impl From<AmqpList> for AmqpMessage {
#[cfg(feature = "cplusplus")]
impl Deserializable<AmqpMessage> for AmqpMessage {
fn decode(data: &[u8]) -> azure_core::Result<AmqpMessage> {
#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
{
let value = serde_amqp::de::from_slice::<
fe2o3_amqp_types::messaging::message::__private::Deserializable<
Expand Down Expand Up @@ -1689,10 +1689,10 @@ mod tests {
let message = AmqpMessage::builder().build();
let serialized = AmqpMessage::serialize(&message).unwrap();
assert_eq!(serialized, vec![0, 0x53, 0x77, 0x40]);
#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
{
// Verify that the serialization of an AmqpMessage with no body matches
// the fe2o3-amqp serialization.
// the fe2o3_amqp serialization.
let body_type: fe2o3_amqp_types::messaging::Body<()> =
fe2o3_amqp_types::messaging::Body::Empty;
let amqp_message = fe2o3_amqp_types::messaging::message::Builder::new()
Expand Down Expand Up @@ -1904,7 +1904,7 @@ mod tests {
]
);

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
{
let amqp_message = fe2o3_amqp_types::messaging::message::Builder::new()
.header(
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure_core_amqp/src/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use super::value::{AmqpOrderedMap, AmqpSymbol, AmqpValue};
use super::ReceiverSettleMode;
use azure_core::error::Result;

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
type ReceiverImplementation = super::fe2o3::receiver::Fe2o3AmqpReceiver;

#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
type ReceiverImplementation = super::noop::NoopAmqpReceiver;

/// Represents the mode of issuing credit to the sender in an AMQP receiver.
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure_core_amqp/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ use super::value::{AmqpOrderedMap, AmqpSymbol, AmqpValue};
use super::{ReceiverSettleMode, SenderSettleMode};
use azure_core::error::Result;

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
type SenderImplementation = super::fe2o3::sender::Fe2o3AmqpSender;

#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
type SenderImplementation = super::noop::NoopAmqpSender;

#[derive(Debug, Default, Clone)]
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/azure_core_amqp/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use super::{
use azure_core::error::Result;
use std::fmt::Debug;

#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
type SessionImplementation = super::fe2o3::session::Fe2o3AmqpSession;

#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
type SessionImplementation = super::noop::NoopAmqpSession;

#[derive(Debug, Default, Clone)]
Expand Down
14 changes: 7 additions & 7 deletions sdk/core/azure_core_amqp/src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::borrow::Borrow;
use crate::fe2o3::error::Fe2o3SerializationError;
#[cfg(all(
feature = "cplusplus",
feature = "fe2o3-amqp",
feature = "fe2o3_amqp",
not(target_arch = "wasm32")
))]
#[cfg(feature = "cplusplus")]
Expand Down Expand Up @@ -271,21 +271,21 @@ pub enum AmqpValue {
#[cfg(feature = "cplusplus")]
impl Serializable for AmqpValue {
fn encoded_size(&self) -> Result<usize> {
#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
{
let fe2o3_value = fe2o3_amqp_types::primitives::Value::from(self.clone());
serde_amqp::serialized_size(&fe2o3_value)
.map_err(|e| azure_core::Error::from(Fe2o3SerializationError(e)))
}
#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
{
unimplemented!("Serialization of AMQP values is not supported")
}
}

#[allow(unused_variables)]
fn serialize(&self, buffer: &mut [u8]) -> Result<()> {
#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
{
let fe2o3_value = fe2o3_amqp_types::primitives::Value::from(self.clone());
let vec = serde_amqp::to_vec(&fe2o3_value).map_err(|e| {
Expand All @@ -295,7 +295,7 @@ impl Serializable for AmqpValue {
buffer.copy_from_slice(bytes);
Ok(())
}
#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
{
unimplemented!("Serialization of AMQP values is not supported")
}
Expand All @@ -306,15 +306,15 @@ impl Serializable for AmqpValue {
impl Deserializable<AmqpValue> for AmqpValue {
#[allow(unused_variables)]
fn decode(data: &[u8]) -> azure_core::Result<AmqpValue> {
#[cfg(all(feature = "fe2o3-amqp", not(target_arch = "wasm32")))]
#[cfg(all(feature = "fe2o3_amqp", not(target_arch = "wasm32")))]
{
let fe2o3_value: fe2o3_amqp_types::primitives::Value = serde_amqp::from_slice(data)
.map_err(|e| {
azure_core::Error::new(azure_core::error::ErrorKind::DataConversion, e)
})?;
Ok(fe2o3_value.into())
}
#[cfg(any(not(feature = "fe2o3-amqp"), target_arch = "wasm32"))]
#[cfg(any(not(feature = "fe2o3_amqp"), target_arch = "wasm32"))]
{
unimplemented!("Deserialization of AMQP values is not supported")
}
Expand Down