Skip to content

Commit

Permalink
Merge branch 'master' into UnitTests
Browse files Browse the repository at this point in the history
rruckley committed Jul 29, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 95a655c + 19e33e2 commit 1e894a7
Showing 4 changed files with 24 additions and 8 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
# tmflib
# TMFLib
![Cargo Build](https://github.com/rruckley/tmflib/actions/workflows/rust.yml/badge.svg)

Rust Library to interact with v4 TMForum APIs. v5 support coming.
## TMF Library for Rust
### Description
This library covers data structures required to interact with various TMForum APIs.
It does not define any persistence nor provide a REST interface (at this stage)
but simply provides definitions of all the schema and helpful functions and traits to create and maniuplate compliant objects
that can then be seriliased into or from JSON as required.

### API Version Features
By default this crate will compile v4 versions of APIs.
* **v4**
This is the default version compiled
* **v5**
This flag can optionally be enabled to compile v5 APIs where available
6 changes: 3 additions & 3 deletions tmflib-derive/Cargo.lock

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

4 changes: 2 additions & 2 deletions tmflib-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tmflib-derive"
version = "0.1.26"
version = "0.1.27"
edition = "2021"
authors = ["Ryan Ruckley <[email protected]>"]
description = "Derive macro for the tmflib::HasId trait"
@@ -13,4 +13,4 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0.86"
quote = "1.0.36"
syn = "2.0.70"
syn = "2.0.72"
5 changes: 4 additions & 1 deletion tmflib-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -243,7 +243,10 @@ pub fn hasrelatedparty_derive(input: TokenStream) -> TokenStream {
let out = quote! {
impl HasRelatedParty for #name {
fn add_party(&mut self, party : RelatedParty) {
self.related_party.as_mut().unwrap().push(party);
match self.related_party.as_mut() {
Some(v) => v.push(party),
None => self.related_party = Some(vec![party]),
}
}
fn get_party(&self, idx : usize ) -> Option<&RelatedParty> {
match self.related_party.as_ref() {

0 comments on commit 1e894a7

Please sign in to comment.