pub struct Parser {
pub options: ParserOptions,
}
Available on crate feature
experimental
only.Expand description
Yet another address parser
新型の住所パーサーです。オプションを指定しない場合はParser::default()
を使用できます。
Fields§
§options: ParserOptions
パーサーのオプションを指定します
Implementations§
Source§impl Parser
impl Parser
Sourcepub async fn parse(&self, address: &str) -> ParsedAddress
pub async fn parse(&self, address: &str) -> ParsedAddress
Parse address into ParsedAddress.
住所をパースし、ParsedAddressを返します。
§Example
use japanese_address_parser::experimental::parser::Parser;
async fn example() {
let parser = Parser::default();
let result = parser.parse("埼玉県所沢市上山口2135").await;
assert_eq!(result.prefecture, "埼玉県");
assert_eq!(result.city, "所沢市");
assert_eq!(result.town, "上山口");
assert_eq!(result.rest, "2135");
assert_eq!(result.metadata.depth, 3);
}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more