Skip to content

Conversation

@sophokles73
Copy link
Contributor

Added a function for checking if an existing UUri is a valid
uProtocol URI.

Addresses #209

Added a function for checking if an existing UUri is a valid
uProtocol URI.
@sophokles73 sophokles73 added the enhancement New feature or request label Nov 12, 2024
@sophokles73
Copy link
Contributor Author

@PLeVasseur is this what you need for uStreamer?

Copy link
Contributor

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sophokles73!

I think this is one half of what I was suggesting adding, please see comments for details.

}
}

fn verify_major_version(major_version: u32) -> Result<u8, UUriError> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Yup, this is definitely one of the functions that'd be useful to have.

/// ```
pub fn check_validity(&self) -> Result<(), UUriError> {
Self::verify_authority(self.authority_name.as_str())?;
Self::verify_major_version(self.ue_version_major)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a verify_resource_id() that'd attempt the conversion to a u16 and include calling that function in here too?
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, absolutely. Don't know how that slipped through. Good that we do the reviews ... ;-)

@sophokles73
Copy link
Contributor Author

@PLeVasseur I have added a corresponding check ...

Copy link
Contributor

@PLeVasseur PLeVasseur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Kai! LGTM

@sophokles73 sophokles73 merged commit 12bb625 into eclipse-uprotocol:main Nov 13, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants