pub struct CaptchaUtil<T: AbstractCaptcha = SpecCaptcha> { /* private fields */ }
Expand description

验证码工具类 - Captcha Utils

默认使用SpecCaptcha(静态PNG字母验证码)作为验证码实现,用户也可以指定其他实现了AbstractCaptcha的类型。

Use SpecCaptcha (static PNG-format alphabetical Captcha) as the default implement of the Captcha service. Users may use other implementation of AbstractCaptcha they prefer.

Trait Implementations§

source§

impl<T: AbstractCaptcha> NewCaptcha for CaptchaUtil<T>

source§

fn new() -> Self

用默认参数初始化 Read more
source§

fn with_size(width: i32, height: i32) -> Self

使用输出图像大小初始化 Read more
source§

fn with_size_and_len(width: i32, height: i32, len: usize) -> Self

使用输出图像大小和验证码字符长度初始化 Read more
source§

fn with_all( width: i32, height: i32, len: usize, font: CaptchaFont, font_size: f32 ) -> Self

使用完整的参数来初始化,包括输出图像大小、验证码字符长度和输出字体及其大小 Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for CaptchaUtil<T>
where T: RefUnwindSafe,

§

impl<T> Send for CaptchaUtil<T>
where T: Send,

§

impl<T> Sync for CaptchaUtil<T>
where T: Sync,

§

impl<T> Unpin for CaptchaUtil<T>
where T: Unpin,

§

impl<T> UnwindSafe for CaptchaUtil<T>
where T: UnwindSafe,

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V