pub struct UnifiClient { /* private fields */ }Implementations§
Source§impl UnifiClient
impl UnifiClient
pub fn new(host: &str, api_key: &str) -> Result<Self, ApiError>
pub fn new_with_options( host: &str, api_key: &str, options: ClientOptions, ) -> Result<Self, ApiError>
pub fn clone_http(&self) -> Client
pub fn base_url(&self) -> &str
pub async fn list_clients(&mut self) -> Result<Vec<Client>, ApiError>
pub async fn get_client_detail( &self, mac: &str, ) -> Result<LegacyClient, ApiError>
pub async fn set_fixed_ip( &self, mac: &str, ip: &str, name: Option<&str>, ) -> Result<(), ApiError>
pub async fn block_client(&self, mac: &str) -> Result<(), ApiError>
pub async fn unblock_client(&self, mac: &str) -> Result<(), ApiError>
pub async fn kick_client(&self, mac: &str) -> Result<(), ApiError>
pub async fn list_devices(&mut self) -> Result<Vec<Device>, ApiError>
pub async fn get_device_detail( &self, mac: &str, ) -> Result<LegacyDevice, ApiError>
pub async fn restart_device(&self, mac: &str) -> Result<(), ApiError>
Sourcepub async fn power_cycle_port(
&self,
mac: &str,
port_idx: u32,
) -> Result<(), ApiError>
pub async fn power_cycle_port( &self, mac: &str, port_idx: u32, ) -> Result<(), ApiError>
Power-cycle a single PoE port. mac is the switch’s MAC, not the
attached device’s.
pub async fn upgrade_device(&self, mac: &str) -> Result<(), ApiError>
pub async fn locate_device( &self, mac: &str, enable: bool, ) -> Result<(), ApiError>
pub async fn list_networks(&mut self) -> Result<Vec<Network>, ApiError>
pub async fn list_events(&self, limit: usize) -> Result<Vec<Event>, ApiError>
pub async fn get_device_ports( &self, mac: &str, ) -> Result<DeviceWithPorts, ApiError>
Sourcepub async fn list_all_device_ports(
&self,
) -> Result<Vec<DeviceWithPorts>, ApiError>
pub async fn list_all_device_ports( &self, ) -> Result<Vec<DeviceWithPorts>, ApiError>
Every device that reports a port table, in one request. /stat/device
already returns all devices with their port tables, so the unfiltered
listing costs no more than the filtered one.
pub async fn list_clients_legacy(&self) -> Result<Vec<LegacyClient>, ApiError>
pub async fn get_legacy_devices(&self) -> Result<Vec<LegacyDevice>, ApiError>
Sourcepub async fn list_protect_cameras(&self) -> Result<Vec<ProtectCamera>, ApiError>
pub async fn list_protect_cameras(&self) -> Result<Vec<ProtectCamera>, ApiError>
List all cameras from the Protect Integration API.
Sourcepub async fn get_protect_camera(
&self,
id: &str,
) -> Result<ProtectCamera, ApiError>
pub async fn get_protect_camera( &self, id: &str, ) -> Result<ProtectCamera, ApiError>
Get a single camera by ID from the Protect Integration API.
Sourcepub async fn get_rtsps_streams(
&self,
camera_id: &str,
) -> Result<RtspsStreams, ApiError>
pub async fn get_rtsps_streams( &self, camera_id: &str, ) -> Result<RtspsStreams, ApiError>
Get existing RTSPS stream URLs for a camera.
Sourcepub async fn create_rtsps_streams(
&self,
camera_id: &str,
qualities: &[String],
) -> Result<RtspsStreams, ApiError>
pub async fn create_rtsps_streams( &self, camera_id: &str, qualities: &[String], ) -> Result<RtspsStreams, ApiError>
Create new RTSPS streams for a camera at the specified quality levels.
Sourcepub async fn delete_rtsps_streams(
&self,
camera_id: &str,
qualities: &[String],
) -> Result<(), ApiError>
pub async fn delete_rtsps_streams( &self, camera_id: &str, qualities: &[String], ) -> Result<(), ApiError>
Delete RTSPS streams for a camera at the specified quality levels.
Sourcepub async fn resolve_camera_id(
&self,
id_or_name: &str,
) -> Result<String, ApiError>
pub async fn resolve_camera_id( &self, id_or_name: &str, ) -> Result<String, ApiError>
Resolve a camera identifier (ID or name) to a camera ID. If the input is a 24-char hex string, treats it as an ID. Otherwise, searches by name (case-insensitive).
A name that fits more than one camera is an error rather than a choice made silently: the caller may be about to delete that camera’s streams, and picking whichever the controller happened to list first would act on a different camera than the one the user was asked to confirm.
pub async fn get_health(&self) -> Result<Vec<HealthSubsystem>, ApiError>
pub async fn get_sysinfo(&self) -> Result<SysInfo, ApiError>
pub async fn get_host_system(&self) -> Result<HostSystem, ApiError>
Auto Trait Implementations§
impl !RefUnwindSafe for UnifiClient
impl !UnwindSafe for UnifiClient
impl Freeze for UnifiClient
impl Send for UnifiClient
impl Sync for UnifiClient
impl Unpin for UnifiClient
impl UnsafeUnpin for UnifiClient
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
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> ⓘ
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> ⓘ
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 moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more