Struct Metadata

Source
pub struct Metadata<'a> {
    pub module_name: &'a str,
    pub namespace: &'a str,
    pub version: &'a str,
    pub java_version: Option<&'a str>,
    pub ios_deployment_target: Option<&'a str>,
    pub min_sdk: Option<u8>,
    pub max_sdk: Option<u8>,
}
Expand description

Representation of the module metadata

Fields§

§module_name: &'a str

The module name.

§namespace: &'a str

The module namespace.

§version: &'a str

The module version.

§java_version: Option<&'a str>

The Java version required by the module (optional).

§ios_deployment_target: Option<&'a str>

The minimum iOS deployment target version (optional).

§min_sdk: Option<u8>

The minimum Android SDK version (optional).

§max_sdk: Option<u8>

The maximum Android SDK version (optional).

Implementations§

Source§

impl<'a> Metadata<'a>

Source

pub fn new(module_name: &'a str, namespace: &'a str, version: &'a str) -> Self

Creates a new Metadata instance with the specified module, namespace, and version.

§Arguments
  • module - The module name.
  • namespace - The module namespace.
  • version - The module version.
§Example
use kmmp_structure::gradle::Metadata;

let metadata = Metadata::new("my-module", "com.example", "1.0.0");
Source

pub fn with_java_version(self, java_version: &'a str) -> Self

Sets the Java version for the module.

§Arguments
  • java_version - The Java version.
§Example
use kmmp_structure::gradle::Metadata;

let metadata = Metadata::new("my-module", "com.example", "1.0.0")
    .with_java_version("1.8");
Source

pub fn with_ios_deployment_target(self, ios_deployment_target: &'a str) -> Self

Sets the iOS deployment target for the module.

§Arguments
  • ios_deployment_target - The iOS deployment target.
§Example
use kmmp_structure::gradle::Metadata;

let metadata = Metadata::new("my-module", "com.example", "1.0.0")
    .with_ios_deployment_target("12.0");
Source

pub fn with_min_sdk(self, min_sdk: u8) -> Self

Sets the minimum SDK version for the module.

§Arguments
  • min_sdk - The minimum SDK version.
§Example
use kmmp_structure::gradle::Metadata;

let metadata = Metadata::new("my-module", "com.example", "1.0.0")
    .with_min_sdk(21);
Source

pub fn with_max_sdk(self, max_sdk: u8) -> Self

Sets the maximum SDK version for the module.

§Arguments
  • max_sdk - The maximum SDK version.
§Example
use kmmp_structure::gradle::Metadata;

let metadata = Metadata::new("my-module", "com.example", "1.0.0")
    .with_max_sdk(30);

Trait Implementations§

Source§

impl<'a> Debug for Metadata<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de: 'a, 'a> Deserialize<'de> for Metadata<'a>

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Metadata<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the Metadata as a string.

§Example
use kmmp_structure::gradle::Metadata;

let metadata = Metadata::new("my-module", "com.example", "1.0.0");

assert_eq!(metadata.to_string(), "/* formatted metadata */");
Source§

impl<'a> PartialEq for Metadata<'a>

Source§

fn eq(&self, other: &Metadata<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> PartialOrd for Metadata<'a>

Source§

fn partial_cmp(&self, other: &Metadata<'a>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> Serialize for Metadata<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a> StructuralPartialEq for Metadata<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Metadata<'a>

§

impl<'a> RefUnwindSafe for Metadata<'a>

§

impl<'a> Send for Metadata<'a>

§

impl<'a> Sync for Metadata<'a>

§

impl<'a> Unpin for Metadata<'a>

§

impl<'a> UnwindSafe for Metadata<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,