pub struct BIC {
pub value: String,
}
Expand description
SWIFT BIC (Bank Identifier Code) with comprehensive validation and utilities
A Bank Identifier Code (BIC) is used to identify financial institutions in SWIFT messages. It consists of either 8 or 11 characters:
- Bank Code (4 characters): Alphabetic
- Country Code (2 characters): Alphabetic (ISO 3166-1 alpha-2)
- Location Code (2 characters): Alphanumeric
- Branch Code (3 characters, optional): Alphanumeric
§Examples
CHASUS33XXX
- Chase Bank, US, New York, Branch: XXXDEUTDEFF
- Deutsche Bank, Germany, Frankfurt (8-character format)
Fields§
§value: String
The full BIC code (8 or 11 characters)
Implementations§
Source§impl BIC
impl BIC
Sourcepub fn new_unchecked(value: impl Into<String>) -> Self
pub fn new_unchecked(value: impl Into<String>) -> Self
Create a BIC without validation (for internal use)
Sourcepub fn parse(value: &str, field_tag: Option<&str>) -> Result<Self, ParseError>
pub fn parse(value: &str, field_tag: Option<&str>) -> Result<Self, ParseError>
Parse a BIC from a string with optional field tag context
Sourcepub fn validate(&self) -> ValidationResult
pub fn validate(&self) -> ValidationResult
Validate BIC and return ValidationResult for field validation
Sourcepub fn country_code(&self) -> &str
pub fn country_code(&self) -> &str
Get the country code (characters 5-6)
Sourcepub fn location_code(&self) -> &str
pub fn location_code(&self) -> &str
Get the location code (characters 7-8)
Sourcepub fn branch_code(&self) -> Option<&str>
pub fn branch_code(&self) -> Option<&str>
Get the branch code if present (characters 9-11)
Sourcepub fn is_full_bic(&self) -> bool
pub fn is_full_bic(&self) -> bool
Check if this is a full BIC (11 characters) vs short BIC (8 characters)
Sourcepub fn is_major_financial_center(&self) -> bool
pub fn is_major_financial_center(&self) -> bool
Check if this institution is in a major financial center
Sourcepub fn is_retail_bank(&self) -> bool
pub fn is_retail_bank(&self) -> bool
Check if this is a retail banking institution (heuristic based on common bank codes)
Sourcepub fn supports_real_time_payments(&self) -> bool
pub fn supports_real_time_payments(&self) -> bool
Check if this institution’s country supports real-time payments
Sourcepub fn regulatory_jurisdiction(&self) -> &'static str
pub fn regulatory_jurisdiction(&self) -> &'static str
Get the regulatory jurisdiction for this institution
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Get a human-readable description of this BIC