pub fn is_valid_with(database: &Database, number: &PhoneNumber) -> bool {
	let code     = number.country().code();
	let national = number.national.to_string();
	let source   = try_opt!(false; source_for(database, code, &national));
	let meta     = try_opt!(false; match source {
		Left(region) =>
			database.by_id(region.as_ref()),

		Right(code) =>
			database.by_code(&code).and_then(|m| m.into_iter().next()),
	});

	number_type(meta, &national) != Type::Unknown
}
/// Check if the phone number is valid with the given `Database`.
Check if the phone number is valid with the given `Database`.
Check if the phone number is valid with the given ` Database ` .
pub fn is_valid_with(database: &Database, number: &PhoneNumber) -> bool {
	let code     = number.country().code();
	let national = number.national.to_string();
	let source   = try_opt!(false; source_for(database, code, &national));
	let meta     = try_opt!(false; match source {
		Left(region) =>
			database.by_id(region.as_ref()),
		Right(code) =>
			database.by_code(&code).and_then(|m| m.into_iter().next()),
	});
	number_type(meta, &national) != Type::Unknown
}
pub fn is_valid_with ( database : & Database , number : & PhoneNumber ) -> bool { let code = number . country ( ) . code ( ) ; let national = number . national . to_string ( ) ; let source = try_opt ! ( false source_for ( database code national ) ) ; let meta = try_opt ! ( false match source { Left ( region ) database by_id ( region as_ref ( ) ) Right ( code ) database by_code ( code ) and_then ( m m into_iter ( ) next ( ) ) } ) ; number_type ( meta , & national ) != Type :: Unknown }
Check if the phone number is valid with the given `Database`.
Check if the phone number is valid with the given ` Database ` .
database
&Database
number
&PhoneNumber