pub struct LinkGenerationService { /* private fields */ }Implementations§
Source§impl LinkGenerationService
impl LinkGenerationService
pub fn new(db: &DbPool) -> Result<Self, ContentError>
pub async fn generate_link( &self, params: GenerateLinkParams, ) -> Result<CampaignLink, ContentError>
pub async fn generate_internal_content_link( &self, params: GenerateContentLinkParams<'_>, ) -> Result<CampaignLink, ContentError>
pub async fn generate_external_cta_link( &self, target_url: &str, campaign_name: &str, source_content_id: Option<ContentId>, link_text: Option<String>, ) -> Result<CampaignLink, ContentError>
pub async fn generate_external_content_link( &self, params: GenerateContentLinkParams<'_>, ) -> Result<CampaignLink, ContentError>
pub async fn get_link_by_short_code( &self, short_code: &str, ) -> Result<Option<CampaignLink>, ContentError>
pub async fn get_link_by_id( &self, id: &LinkId, ) -> Result<Option<CampaignLink>, ContentError>
pub async fn delete_link(&self, id: &LinkId) -> Result<bool, ContentError>
pub fn build_trackable_url(link: &CampaignLink, base_url: &str) -> String
pub fn inject_utm_params(url: &str, utm_params: &UtmParams) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkGenerationService
impl !RefUnwindSafe for LinkGenerationService
impl Send for LinkGenerationService
impl Sync for LinkGenerationService
impl Unpin for LinkGenerationService
impl !UnwindSafe for LinkGenerationService
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more