pub struct LinkedInValidator { /* private fields */ }Expand description
A LinkedIn profile validator that performs HTTP requests to verify profile existence.
§Example
use linkedin_profile_validator::LinkedInValidator;
let validator = LinkedInValidator::new();
let result = validator.is_valid_linkedin_profile_url("https://www.linkedin.com/in/johndoe");Implementations§
Source§impl LinkedInValidator
impl LinkedInValidator
Sourcepub fn is_valid_linkedin_profile_url(
&self,
url_str: &str,
) -> Result<bool, LinkedInUrlError>
pub fn is_valid_linkedin_profile_url( &self, url_str: &str, ) -> Result<bool, LinkedInUrlError>
Validates a LinkedIn profile URL by checking format and existence.
This method performs an HTTP request to verify if the profile actually exists.
§Arguments
url_str- TheLinkedInprofile URL to validate
§Returns
Ok(true)- If the profile existsErr(LinkedInUrlError)- If validation fails
§Errors
Returns an error if:
- The URL format is invalid
- The URL is not from
LinkedIndomain - The URL is not a profile URL
- Network request fails
- The profile doesn’t exist (404)
LinkedInrequires authentication
§Example
use linkedin_profile_validator::LinkedInValidator;
let validator = LinkedInValidator::new();
match validator.is_valid_linkedin_profile_url("https://www.linkedin.com/in/johndoe") {
Ok(_) => println!("Valid profile"),
Err(e) => println!("Invalid: {}", e),
}Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LinkedInValidator
impl !UnwindSafe for LinkedInValidator
impl Freeze for LinkedInValidator
impl Send for LinkedInValidator
impl Sync for LinkedInValidator
impl Unpin for LinkedInValidator
impl UnsafeUnpin for LinkedInValidator
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