Target
One normalized target.
One normalized target.
use sponsorkit::Target;
pub struct Target {
pub provider: Provider,
pub account: String,
}Fields#
provider#
pub provider: ProviderThe provider.
account#
pub account: StringThe lowercased, trimmed login or slug.
Methods#
new#
pub fn new(provider: Provider, account: &str) -> Result<Target>Normalizes (trim + lowercase) and validates an account for a provider.
Returns an invalid_config error for malformed accounts.
| Parameter | Type |
|---|---|
provider | Provider |
account | &str |
Returns: Result<Target> (see Result, Target)
parse#
pub fn parse(s: &str) -> Result<Target>Parses "<provider>:<account>".
| Parameter | Type |
|---|---|
s | &str |
Returns: Result<Target> (see Result, Target)
Trait implementations#
impl Clone for Targetimpl Debug for Targetimpl Display for Targetimpl Eq for Targetimpl Hash for Targetimpl PartialEq for Target