Skip to main content

LINE

Struct LINE 

Source
pub struct LINE {
    pub channel_access_token_api_client: ChannelAccessTokenApiClient<HttpsConnector<HttpConnector>>,
    pub insight_api_client: InsightApiClient<HttpsConnector<HttpConnector>>,
    pub liff_api_client: LiffApiClient<HttpsConnector<HttpConnector>>,
    pub manage_audience_api_client: ManageAudienceApiClient<HttpsConnector<HttpConnector>>,
    pub manage_audience_blob_api_client: ManageAudienceBlobApiClient<HttpsConnector<HttpConnector>>,
    pub messaging_api_client: MessagingApiApiClient<HttpsConnector<HttpConnector>>,
    pub messaging_api_blob_client: MessagingApiBlobApiClient<HttpsConnector<HttpConnector>>,
    pub module_api_client: LineModuleApiClient<HttpsConnector<HttpConnector>>,
    pub module_attach_api_client: LineModuleAttachApiClient<HttpsConnector<HttpConnector>>,
    pub shop_api_client: ShopApiClient<HttpsConnector<HttpConnector>>,
    pub webhook_dummy_api_client: DummyApiClient<HttpsConnector<HttpConnector>>,
}
Expand description

A unified client for all LINE Platform APIs.

LINE bundles all API-specific clients, each configured with the same channel access token and sharing a single HTTPS connection pool via hyper.

§Example

use line_bot_sdk_rust::client::LINE;
use line_bot_sdk_rust::line_messaging_api::apis::MessagingApiApi;
use line_bot_sdk_rust::line_messaging_api::models::{
    Message, ReplyMessageRequest, TextMessage,
};

let line = LINE::new("YOUR_CHANNEL_ACCESS_TOKEN".to_string());

let req = ReplyMessageRequest {
    reply_token: "reply_token".to_string(),
    messages: vec![Message::Text(TextMessage::new("Hello!".to_string()))],
    notification_disabled: Some(false),
};
let _ = line.messaging_api_client.reply_message(req).await;

Fields§

§channel_access_token_api_client: ChannelAccessTokenApiClient<HttpsConnector<HttpConnector>>§insight_api_client: InsightApiClient<HttpsConnector<HttpConnector>>§liff_api_client: LiffApiClient<HttpsConnector<HttpConnector>>§manage_audience_api_client: ManageAudienceApiClient<HttpsConnector<HttpConnector>>§manage_audience_blob_api_client: ManageAudienceBlobApiClient<HttpsConnector<HttpConnector>>§messaging_api_client: MessagingApiApiClient<HttpsConnector<HttpConnector>>§messaging_api_blob_client: MessagingApiBlobApiClient<HttpsConnector<HttpConnector>>§module_api_client: LineModuleApiClient<HttpsConnector<HttpConnector>>§module_attach_api_client: LineModuleAttachApiClient<HttpsConnector<HttpConnector>>§shop_api_client: ShopApiClient<HttpsConnector<HttpConnector>>§webhook_dummy_api_client: DummyApiClient<HttpsConnector<HttpConnector>>

Implementations§

Source§

impl LINE

Source

pub fn new(token: String) -> LINE

Creates a new LINE client with the given channel access token.

All API-specific clients are initialized with the same token and share a single HTTPS connection via hyper + hyper-rustls.

Source

pub fn builder(token: String) -> LINEBuilder

Returns a LINEBuilder for constructing a LINE client with custom settings.

§Example
use std::time::Duration;
use line_bot_sdk_rust::client::LINE;

let line = LINE::builder("YOUR_CHANNEL_ACCESS_TOKEN".to_string())
    .timeout(Duration::from_secs(30))
    .build();

Trait Implementations§

Source§

impl Clone for LINE

Source§

fn clone(&self) -> LINE

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl Freeze for LINE

§

impl !RefUnwindSafe for LINE

§

impl Send for LINE

§

impl Sync for LINE

§

impl Unpin for LINE

§

impl UnsafeUnpin for LINE

§

impl !UnwindSafe for LINE

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more