This is an automated email from the ASF dual-hosted git repository. martinzink pushed a commit to branch minifi_rust_pgp in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
commit fef93690b17184b24b83c3b96de8728b2e686485 Author: Martin Zink <[email protected]> AuthorDate: Thu Aug 13 18:47:00 2026 +0200 K -> P in Property context --- minifi_rust/minifi_native/src/api/property.rs | 30 +++++++++++++-------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/minifi_rust/minifi_native/src/api/property.rs b/minifi_rust/minifi_native/src/api/property.rs index 26049042a..41186f1e2 100644 --- a/minifi_rust/minifi_native/src/api/property.rs +++ b/minifi_rust/minifi_native/src/api/property.rs @@ -62,16 +62,16 @@ macro_rules! property_definitions { }; } -pub struct Property<K: ?Sized + PropertySchema> { +pub struct Property<P: ?Sized + PropertySchema> { pub(crate) name: &'static str, pub(crate) description: &'static str, pub(crate) is_sensitive: bool, pub(crate) supports_expr_lang: bool, pub(crate) default_value: Option<&'static str>, - pub(crate) marker: PhantomData<K>, + pub(crate) marker: PhantomData<P>, } -impl<K: ?Sized + PropertySchema> Property<K> { +impl<P: ?Sized + PropertySchema> Property<P> { pub const fn new(name: &'static str, description: &'static str) -> Self { Property { name, @@ -106,11 +106,11 @@ impl<K: ?Sized + PropertySchema> Property<K> { PropertyDefinition { name: self.name, description: self.description, - is_required: K::IS_REQUIRED, + is_required: P::IS_REQUIRED, is_sensitive: self.is_sensitive, supports_expr_lang: self.supports_expr_lang, default_value: self.default_value, - constraints: K::CONSTRAINT, + constraints: P::CONSTRAINT, } } @@ -237,16 +237,16 @@ impl PropertySchema for NonBlankPath { } pub trait GetProperty { - fn get_raw_property<K: PropertySchema + ?Sized>( + fn get_raw_property<P: PropertySchema + ?Sized>( &self, - property: &Property<K>, + property: &Property<P>, ) -> Result<Option<String>, MinifiError>; - fn get_property<K: PropertyValue + ?Sized>( + fn get_property<P: PropertyValue + ?Sized>( &self, - property: &Property<K>, - ) -> Result<K::Output, MinifiError> { - K::from_raw(self.get_raw_property(property)?, property.name) + property: &Property<P>, + ) -> Result<P::Output, MinifiError> { + P::from_raw(self.get_raw_property(property)?, property.name) } } @@ -297,10 +297,10 @@ where } pub trait GetControllerService { - fn get_controller_service<K>( + fn get_controller_service<P>( &self, - property: &Property<K>, - ) -> Result<K::Output<'_>, MinifiError> + property: &Property<P>, + ) -> Result<P::Output<'_>, MinifiError> where - K: ControllerServiceValue + ?Sized; + P: ControllerServiceValue + ?Sized; }
