Skip to content

Commit

Permalink
impl From<ServiceId> for ServiceAddress
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Oct 12, 2024
1 parent 9a95d3a commit 6b97681
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions libsignal-service/src/service_address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,19 @@ impl ServiceAddress {
}
}

impl From<ServiceId> for ServiceAddress {

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust beta)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust nightly)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust nightly)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust beta)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust beta)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / clippy

cannot find type `ServiceId` in this scope

error[E0412]: cannot find type `ServiceId` in this scope --> libsignal-service/src/service_address.rs:90:11 | 90 | impl From<ServiceId> for ServiceAddress { | ^^^^^^^^^ | ::: /home/runner/.cargo/git/checkouts/libsignal-e5ca3c64ee2f7cbe/e46841e/rust/core/src/address.rs:671:1 | 671 | pub struct DeviceId(u32); | ------------------- similarly named struct `DeviceId` defined here | help: a struct with a similar name exists | 90 | impl From<DeviceId> for ServiceAddress { | ~~~~~~~~ help: consider importing one of these enums | 1 + use crate::protocol::ServiceId; | 1 + use libsignal_protocol::ServiceId; |

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust nightly)

cannot find type `ServiceId` in this scope

Check failure on line 90 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust 1.75)

cannot find type `ServiceId` in this scope
fn from(service_id: ServiceId) -> Self {

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust beta)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust nightly)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust nightly)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust beta)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust stable)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust beta)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / clippy

cannot find type `ServiceId` in this scope

error[E0412]: cannot find type `ServiceId` in this scope --> libsignal-service/src/service_address.rs:91:25 | 91 | fn from(service_id: ServiceId) -> Self { | ^^^^^^^^^ | ::: /home/runner/.cargo/git/checkouts/libsignal-e5ca3c64ee2f7cbe/e46841e/rust/core/src/address.rs:671:1 | 671 | pub struct DeviceId(u32); | ------------------- similarly named struct `DeviceId` defined here | help: a struct with a similar name exists | 91 | fn from(service_id: DeviceId) -> Self { | ~~~~~~~~ help: consider importing one of these enums | 1 + use crate::protocol::ServiceId; | 1 + use libsignal_protocol::ServiceId; |

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust nightly)

cannot find type `ServiceId` in this scope

Check failure on line 91 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust 1.75)

cannot find type `ServiceId` in this scope
match service_id {
ServiceId::Aci(service_id) => {

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust beta)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust nightly)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust nightly)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust beta)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust beta)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / clippy

failed to resolve: use of undeclared type `ServiceId`

error[E0433]: failed to resolve: use of undeclared type `ServiceId` --> libsignal-service/src/service_address.rs:93:13 | 93 | ServiceId::Aci(service_id) => { | ^^^^^^^^^ use of undeclared type `ServiceId` | help: a struct with a similar name exists | 93 | DeviceId::Aci(service_id) => { | ~~~~~~~~ help: consider importing one of these enums | 1 + use crate::protocol::ServiceId; | 1 + use libsignal_protocol::ServiceId; |

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust nightly)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 93 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust 1.75)

failed to resolve: use of undeclared type `ServiceId`
ServiceAddress::from_aci(service_id.into())

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust beta)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust nightly)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust nightly)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust beta)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust stable)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust beta)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / clippy

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope

error[E0599]: no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope --> libsignal-service/src/service_address.rs:94:33 | 18 | pub struct ServiceAddress { | ------------------------- function or associated item `from_aci` not found for this struct ... 94 | ServiceAddress::from_aci(service_id.into()) | ^^^^^^^^ function or associated item not found in `ServiceAddress` | note: if you're trying to build a new `service_address::ServiceAddress` consider using one of the following associated functions: service_address::ServiceAddress::new_aci service_address::ServiceAddress::new_pni --> libsignal-service/src/service_address.rs:51:5 | 51 | pub fn new_aci(uuid: Uuid) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 58 | pub fn new_pni(uuid: Uuid) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: there is an associated function `from` with a similar name | 94 | ServiceAddress::from(service_id.into()) | ~~~~

Check failure on line 94 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust nightly)

no function or associated item named `from_aci` found for struct `service_address::ServiceAddress` in the current scope
},
ServiceId::Pni(service_id) => {

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust beta)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust nightly)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust nightly)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust beta)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust stable)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust beta)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / clippy

failed to resolve: use of undeclared type `ServiceId`

error[E0433]: failed to resolve: use of undeclared type `ServiceId` --> libsignal-service/src/service_address.rs:96:13 | 96 | ServiceId::Pni(service_id) => { | ^^^^^^^^^ use of undeclared type `ServiceId` | help: a struct with a similar name exists | 96 | DeviceId::Pni(service_id) => { | ~~~~~~~~ help: consider importing one of these enums | 1 + use crate::protocol::ServiceId; | 1 + use libsignal_protocol::ServiceId; |

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust nightly)

failed to resolve: use of undeclared type `ServiceId`

Check failure on line 96 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust 1.75)

failed to resolve: use of undeclared type `ServiceId`
ServiceAddress::from_pni(service_id.into())

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust stable)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust beta)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service, Rust nightly)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust nightly)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust stable)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-hyper, Rust beta)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust stable)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust beta)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / clippy

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope

error[E0599]: no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope --> libsignal-service/src/service_address.rs:97:33 | 18 | pub struct ServiceAddress { | ------------------------- function or associated item `from_pni` not found for this struct ... 97 | ServiceAddress::from_pni(service_id.into()) | ^^^^^^^^ function or associated item not found in `ServiceAddress` | note: if you're trying to build a new `service_address::ServiceAddress` consider using one of the following associated functions: service_address::ServiceAddress::new_aci service_address::ServiceAddress::new_pni --> libsignal-service/src/service_address.rs:51:5 | 51 | pub fn new_aci(uuid: Uuid) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... 58 | pub fn new_pni(uuid: Uuid) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: there is an associated function `from` with a similar name | 97 | ServiceAddress::from(service_id.into()) | ~~~~

Check failure on line 97 in libsignal-service/src/service_address.rs

View workflow job for this annotation

GitHub Actions / Build (libsignal-service-actix, Rust nightly)

no function or associated item named `from_pni` found for struct `service_address::ServiceAddress` in the current scope
},
}
}
}

impl TryFrom<&ProtocolAddress> for ServiceAddress {
type Error = ParseServiceAddressError;

Expand Down

0 comments on commit 6b97681

Please sign in to comment.