1 /* 2 * Copyright (C) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 //! taskbase 16 #![allow(missing_docs)] 17 18 use crate::config::HdcCommand; 19 20 pub trait TaskBase: Send + Sync + 'static { command_dispatchnull21 fn command_dispatch( 22 &mut self, 23 _command: HdcCommand, 24 _payload: &[u8], 25 _payload_size: u16, 26 ) -> bool; stop_tasknull27 fn stop_task(&mut self); ready_for_releasenull28 fn ready_for_release(&mut self) -> bool; channel_idnull29 fn channel_id(&self) -> u32 { 30 0 31 } task_finishnull32 fn task_finish(&self); 33 } 34